about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-03 07:03:43 +0200
committerGitHub <noreply@github.com>2025-06-03 07:03:43 +0200
commit8db68816202c48148b5a07a26f6634b86c041db0 (patch)
tree48516891f497bd23d2dce4e4f742df9694b4f786 /compiler/rustc_resolve/src
parentaed1171c66549b676648aea359ddffc80fd54a8a (diff)
parent8747ccbcdf54fe8227e10bc2584f3e9a2fee9103 (diff)
downloadrust-8db68816202c48148b5a07a26f6634b86c041db0.tar.gz
rust-8db68816202c48148b5a07a26f6634b86c041db0.zip
Rollup merge of #141741 - nnethercote:overhaul-UsePath, r=petrochenkov
Overhaul `UsePath`

It currently uses `SmallVec<[Res; 3]>` which is really weird. Details in the individual commits.

r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/check_unused.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs
index e0b2adb3fc9..9b824572b66 100644
--- a/compiler/rustc_resolve/src/check_unused.rs
+++ b/compiler/rustc_resolve/src/check_unused.rs
@@ -118,9 +118,10 @@ impl<'a, 'ra, 'tcx> UnusedImportCheckVisitor<'a, 'ra, 'tcx> {
             ast::UseTreeKind::Simple(Some(ident)) => {
                 if ident.name == kw::Underscore
                     && !self.r.import_res_map.get(&id).is_some_and(|per_ns| {
-                        per_ns.iter().filter_map(|res| res.as_ref()).any(|res| {
-                            matches!(res, Res::Def(DefKind::Trait | DefKind::TraitAlias, _))
-                        })
+                        matches!(
+                            per_ns.type_ns,
+                            Some(Res::Def(DefKind::Trait | DefKind::TraitAlias, _))
+                        )
                     })
                 {
                     self.unused_import(self.base_id).add(id);