diff options
| author | bors <bors@rust-lang.org> | 2024-11-19 19:54:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-19 19:54:35 +0000 |
| commit | ee612c45f00391aff71ec0c52b7fc08fae18c711 (patch) | |
| tree | 25a514e911a649d105d391e9b3e6ec412d4dc111 /compiler/rustc_resolve/src/diagnostics.rs | |
| parent | 78993684f2ba22082197d63627f3e91069911839 (diff) | |
| parent | 12747f188a9dba7b13cf1ccb01fef74c6ce3294e (diff) | |
| download | rust-ee612c45f00391aff71ec0c52b7fc08fae18c711.tar.gz rust-ee612c45f00391aff71ec0c52b7fc08fae18c711.zip | |
Auto merge of #132761 - nnethercote:resolve-tweaks, r=petrochenkov
Resolve tweaks A couple of small perf improvements, and some minor refactorings, all in `rustc_resolve`. r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_resolve/src/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 5437ca65935..5b78acd904a 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -535,14 +535,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { filter_fn: &impl Fn(Res) -> bool, ctxt: Option<SyntaxContext>, ) { - for (key, resolution) in self.resolutions(module).borrow().iter() { - if let Some(binding) = resolution.borrow().binding { - let res = binding.res(); - if filter_fn(res) && ctxt.map_or(true, |ctxt| ctxt == key.ident.span.ctxt()) { - names.push(TypoSuggestion::typo_from_ident(key.ident, res)); - } + module.for_each_child(self, |_this, ident, _ns, binding| { + let res = binding.res(); + if filter_fn(res) && ctxt.map_or(true, |ctxt| ctxt == ident.span.ctxt()) { + names.push(TypoSuggestion::typo_from_ident(ident, res)); } - } + }); } /// Combines an error with provided span and emits it. |
