diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-05 00:12:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-05 00:12:09 +0200 |
| commit | 031bf9715a18ad37677cfbc0e47e0b9af436e96d (patch) | |
| tree | de6fa25bfb9e29cfa3e2efee1d62d577ab6f5ebf | |
| parent | afe8ee34a773421cbd583c58ea13a66a5ed44980 (diff) | |
| parent | 2d3ff91add77a2ae5959f5134e12f5c0eec59ce5 (diff) | |
| download | rust-031bf9715a18ad37677cfbc0e47e0b9af436e96d.tar.gz rust-031bf9715a18ad37677cfbc0e47e0b9af436e96d.zip | |
Rollup merge of #143372 - cjgillot:bare-glob-map, r=petrochenkov
Remove names_imported_by_glob_use query. Based on https://github.com/rust-lang/rust/pull/143247 r? ``@ghost`` for perf
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 4 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/wildcard_imports.rs | 2 |
3 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index aefae3a3b14..17a29c9ae4b 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -2264,9 +2264,6 @@ rustc_queries! { query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> { desc { "fetching potentially unused trait imports" } } - query names_imported_by_glob_use(def_id: LocalDefId) -> &'tcx FxIndexSet<Symbol> { - desc { |tcx| "finding names imported by glob use for `{}`", tcx.def_path_str(def_id) } - } query stability_index(_: ()) -> &'tcx stability::Index { arena_cache diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index e56f98291f1..e8b15b76fd8 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -3417,10 +3417,6 @@ pub struct DeducedParamAttrs { pub fn provide(providers: &mut Providers) { providers.maybe_unused_trait_imports = |tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports; - providers.names_imported_by_glob_use = |tcx, id| { - tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default()) - }; - providers.extern_mod_stmt_cnum = |tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned(); providers.is_panic_runtime = diff --git a/src/tools/clippy/clippy_lints/src/wildcard_imports.rs b/src/tools/clippy/clippy_lints/src/wildcard_imports.rs index d9dda6eadb2..22fd15d153a 100644 --- a/src/tools/clippy/clippy_lints/src/wildcard_imports.rs +++ b/src/tools/clippy/clippy_lints/src/wildcard_imports.rs @@ -130,7 +130,7 @@ impl LateLintPass<'_> for WildcardImports { } if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind && (self.warn_on_all || !self.check_exceptions(cx, item, use_path.segments)) - && let used_imports = cx.tcx.names_imported_by_glob_use(item.owner_id.def_id) + && let Some(used_imports) = cx.tcx.resolutions(()).glob_map.get(&item.owner_id.def_id) && !used_imports.is_empty() // Already handled by `unused_imports` && !used_imports.contains(&kw::Underscore) { |
