Skip to content

Commit

Permalink
convert all_macro_rules from hashmap to hashset
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Feb 21, 2025
1 parent 918b5c3 commit 8d2de63
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub struct ResolverGlobalCtxt {
pub confused_type_with_std_module: FxIndexMap<Span, Span>,
pub doc_link_resolutions: FxIndexMap<LocalDefId, DocLinkResMap>,
pub doc_link_traits_in_scope: FxIndexMap<LocalDefId, Vec<DefId>>,
pub all_macro_rules: FxHashMap<Symbol, Res<ast::NodeId>>,
pub all_macro_rules: FxHashSet<Symbol>,
pub stripped_cfg_items: Steal<Vec<StrippedCfgItem>>,
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
};
let binding = (res, vis, span, expansion).to_name_binding(self.r.arenas);
self.r.set_binding_parent_module(binding, parent_scope.module);
self.r.all_macro_rules.insert(ident.name, res);
self.r.all_macro_rules.insert(ident.name);
if is_macro_export {
let import = self.r.arenas.alloc_import(ImportData {
kind: ImportKind::MacroExport,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ pub struct Resolver<'ra, 'tcx> {
effective_visibilities: EffectiveVisibilities,
doc_link_resolutions: FxIndexMap<LocalDefId, DocLinkResMap>,
doc_link_traits_in_scope: FxIndexMap<LocalDefId, Vec<DefId>>,
all_macro_rules: FxHashMap<Symbol, Res>,
all_macro_rules: FxHashSet<Symbol>,

/// Invocation ids of all glob delegations.
glob_delegation_invoc_ids: FxHashSet<LocalExpnId>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@ fn resolution_failure(
.tcx
.resolutions(())
.all_macro_rules
.contains_key(&Symbol::intern(path_str))
.contains(&Symbol::intern(path_str))
{
diag.note(format!(
"`macro_rules` named `{path_str}` exists in this crate, \
Expand Down

0 comments on commit 8d2de63

Please sign in to comment.