Make crate_inherent_impls fallible and stop using track_errors for it

This commit is contained in:
Oli Scherer 2024-01-12 14:29:54 +00:00
parent 49347ee12d
commit 557b111870
19 changed files with 115 additions and 73 deletions

View file

@ -1745,12 +1745,10 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
// Doing analysis on local `DefId`s would cause infinite recursion.
return;
}
let Ok(impls) = self.r.tcx.inherent_impls(def_id) else { return };
// Look at all the associated functions without receivers in the type's
// inherent impls to look for builders that return `Self`
let mut items = self
.r
.tcx
.inherent_impls(def_id)
let mut items = impls
.iter()
.flat_map(|i| self.r.tcx.associated_items(i).in_definition_order())
// Only assoc fn with no receivers.