Skip to content

Commit cfc2d11

Browse files
authored
Rollup merge of rust-lang#137392 - klensy:unused, r=compiler-errors
remove few unused fields Remove unused field and convert hashmap to hashset in second commit.
2 parents 45b4314 + 8d2de63 commit cfc2d11

File tree

5 files changed

+4
-6
lines changed

5 files changed

+4
-6
lines changed

compiler/rustc_middle/src/ty/context.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,6 @@ pub struct GlobalCtxt<'tcx> {
13701370

13711371
// Internal caches for metadata decoding. No need to track deps on this.
13721372
pub ty_rcache: Lock<FxHashMap<ty::CReaderCacheKey, Ty<'tcx>>>,
1373-
pub pred_rcache: Lock<FxHashMap<ty::CReaderCacheKey, Predicate<'tcx>>>,
13741373

13751374
/// Caches the results of trait selection. This cache is used
13761375
/// for things that do not have to do with the parameters in scope.
@@ -1601,7 +1600,6 @@ impl<'tcx> TyCtxt<'tcx> {
16011600
query_system,
16021601
query_kinds,
16031602
ty_rcache: Default::default(),
1604-
pred_rcache: Default::default(),
16051603
selection_cache: Default::default(),
16061604
evaluation_cache: Default::default(),
16071605
new_solver_evaluation_cache: Default::default(),

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub struct ResolverGlobalCtxt {
179179
pub confused_type_with_std_module: FxIndexMap<Span, Span>,
180180
pub doc_link_resolutions: FxIndexMap<LocalDefId, DocLinkResMap>,
181181
pub doc_link_traits_in_scope: FxIndexMap<LocalDefId, Vec<DefId>>,
182-
pub all_macro_rules: FxHashMap<Symbol, Res<ast::NodeId>>,
182+
pub all_macro_rules: FxHashSet<Symbol>,
183183
pub stripped_cfg_items: Steal<Vec<StrippedCfgItem>>,
184184
}
185185

compiler/rustc_resolve/src/build_reduced_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
12411241
};
12421242
let binding = (res, vis, span, expansion).to_name_binding(self.r.arenas);
12431243
self.r.set_binding_parent_module(binding, parent_scope.module);
1244-
self.r.all_macro_rules.insert(ident.name, res);
1244+
self.r.all_macro_rules.insert(ident.name);
12451245
if is_macro_export {
12461246
let import = self.r.arenas.alloc_import(ImportData {
12471247
kind: ImportKind::MacroExport,

compiler/rustc_resolve/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ pub struct Resolver<'ra, 'tcx> {
12201220
effective_visibilities: EffectiveVisibilities,
12211221
doc_link_resolutions: FxIndexMap<LocalDefId, DocLinkResMap>,
12221222
doc_link_traits_in_scope: FxIndexMap<LocalDefId, Vec<DefId>>,
1223-
all_macro_rules: FxHashMap<Symbol, Res>,
1223+
all_macro_rules: FxHashSet<Symbol>,
12241224

12251225
/// Invocation ids of all glob delegations.
12261226
glob_delegation_invoc_ids: FxHashSet<LocalExpnId>,

src/librustdoc/passes/collect_intra_doc_links.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ fn resolution_failure(
19831983
.tcx
19841984
.resolutions(())
19851985
.all_macro_rules
1986-
.contains_key(&Symbol::intern(path_str))
1986+
.contains(&Symbol::intern(path_str))
19871987
{
19881988
diag.note(format!(
19891989
"`macro_rules` named `{path_str}` exists in this crate, \

0 commit comments

Comments
 (0)