Skip to content

Commit 031bf97

Browse files
authored
Rollup merge of #143372 - cjgillot:bare-glob-map, r=petrochenkov
Remove names_imported_by_glob_use query. Based on #143247 r? ``@ghost`` for perf
2 parents afe8ee3 + 2d3ff91 commit 031bf97

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

compiler/rustc_middle/src/query/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,9 +2264,6 @@ rustc_queries! {
22642264
query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> {
22652265
desc { "fetching potentially unused trait imports" }
22662266
}
2267-
query names_imported_by_glob_use(def_id: LocalDefId) -> &'tcx FxIndexSet<Symbol> {
2268-
desc { |tcx| "finding names imported by glob use for `{}`", tcx.def_path_str(def_id) }
2269-
}
22702267

22712268
query stability_index(_: ()) -> &'tcx stability::Index {
22722269
arena_cache

compiler/rustc_middle/src/ty/context.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3417,10 +3417,6 @@ pub struct DeducedParamAttrs {
34173417
pub fn provide(providers: &mut Providers) {
34183418
providers.maybe_unused_trait_imports =
34193419
|tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports;
3420-
providers.names_imported_by_glob_use = |tcx, id| {
3421-
tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default())
3422-
};
3423-
34243420
providers.extern_mod_stmt_cnum =
34253421
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
34263422
providers.is_panic_runtime =

src/tools/clippy/clippy_lints/src/wildcard_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl LateLintPass<'_> for WildcardImports {
130130
}
131131
if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind
132132
&& (self.warn_on_all || !self.check_exceptions(cx, item, use_path.segments))
133-
&& let used_imports = cx.tcx.names_imported_by_glob_use(item.owner_id.def_id)
133+
&& let Some(used_imports) = cx.tcx.resolutions(()).glob_map.get(&item.owner_id.def_id)
134134
&& !used_imports.is_empty() // Already handled by `unused_imports`
135135
&& !used_imports.contains(&kw::Underscore)
136136
{

0 commit comments

Comments
 (0)