Skip to content

Commit 48e1df8

Browse files
committed
Arbitrary self types v2: deshadow quicker
A previous commit added a search for certain types of "shadowing" situation where one method (in an outer smart pointer type, typically) might hide or shadow the method in the pointee. Performance investigation showed that the naïve approach is too slow - this commit speeds it up, while being functionally the same. This still does not actually cause the deshadowing check to emit any errors; that comes in a subsequent commit which is where all the tests live.
1 parent 2707f55 commit 48e1df8

File tree

2 files changed

+174
-38
lines changed

2 files changed

+174
-38
lines changed

Diff for: compiler/rustc_hir_typeck/src/demand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
917917
[candidate] => format!(
918918
"the method of the same name on {} `{}`",
919919
match candidate.kind {
920-
probe::CandidateKind::InherentImplCandidate(_) => "the inherent impl for",
920+
probe::CandidateKind::InherentImplCandidate { .. } => "the inherent impl for",
921921
_ => "trait",
922922
},
923923
self.tcx.def_path_str(candidate.item.container_id(self.tcx))

0 commit comments

Comments
 (0)