Skip to content

Commit cd82e45

Browse files
committed
Auto merge of rust-lang#83293 - osa1:82436_perf, r=varkor
Revert performance-sensitive change in rust-lang#82436 This change was done in rust-lang#82436, as an "optimization". Unfortunately I missed that this code is not always executed, because of the "continue" in the conditional above it. This commit should solve the perf regressions introduced by rust-lang#82436 as I think there isn't anything else that could affect runtime performance in that PR. The `Pick` type grows only one word, which I doubt can cause up to 8.8% increase in RSS in some of the benchmarks. --- Could someone with the rights start a perf job please?
2 parents 6bfbf0c + f925757 commit cd82e45

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_typeck/src/check/method

1 file changed

+3
-3
lines changed

compiler/rustc_typeck/src/check/method/probe.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -742,16 +742,16 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
742742

743743
debug!("assemble_inherent_impl_probe {:?}", impl_def_id);
744744

745-
let (impl_ty, impl_substs) = self.impl_ty_and_substs(impl_def_id);
746-
let impl_ty = impl_ty.subst(self.tcx, impl_substs);
747-
748745
for item in self.impl_or_trait_item(impl_def_id) {
749746
if !self.has_applicable_self(&item) {
750747
// No receiver declared. Not a candidate.
751748
self.record_static_candidate(ImplSource(impl_def_id));
752749
continue;
753750
}
754751

752+
let (impl_ty, impl_substs) = self.impl_ty_and_substs(impl_def_id);
753+
let impl_ty = impl_ty.subst(self.tcx, impl_substs);
754+
755755
// Determine the receiver type that the method itself expects.
756756
let xform_tys = self.xform_self_ty(&item, impl_ty, impl_substs);
757757

0 commit comments

Comments
 (0)