Skip to content

Commit e566783

Browse files
Use reference for MacroRulesScopeRef instead of Interned.
1 parent e9e31b1 commit e566783

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

compiler/rustc_resolve/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ impl<'ra> ResolverArenas<'ra> {
12901290
self.name_resolutions.alloc(Default::default())
12911291
}
12921292
fn alloc_macro_rules_scope(&'ra self, scope: MacroRulesScope<'ra>) -> MacroRulesScopeRef<'ra> {
1293-
Interned::new_unchecked(self.dropless.alloc(Cell::new(scope)))
1293+
self.dropless.alloc(Cell::new(scope))
12941294
}
12951295
fn alloc_macro_rules_binding(
12961296
&'ra self,

compiler/rustc_resolve/src/macros.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use rustc_ast::expand::StrippedCfgItem;
99
use rustc_ast::{self as ast, Crate, NodeId, attr};
1010
use rustc_ast_pretty::pprust;
1111
use rustc_attr_data_structures::StabilityLevel;
12-
use rustc_data_structures::intern::Interned;
1312
use rustc_errors::{Applicability, DiagCtxtHandle, StashKey};
1413
use rustc_expand::base::{
1514
Annotatable, DeriveResolution, Indeterminate, ResolverExpand, SyntaxExtension,
@@ -80,7 +79,7 @@ pub(crate) enum MacroRulesScope<'ra> {
8079
/// This helps to avoid uncontrollable growth of `macro_rules!` scope chains,
8180
/// which usually grow linearly with the number of macro invocations
8281
/// in a module (including derives) and hurt performance.
83-
pub(crate) type MacroRulesScopeRef<'ra> = Interned<'ra, Cell<MacroRulesScope<'ra>>>;
82+
pub(crate) type MacroRulesScopeRef<'ra> = &'ra Cell<MacroRulesScope<'ra>>;
8483

8584
/// Macro namespace is separated into two sub-namespaces, one for bang macros and
8685
/// one for attribute-like macros (attributes, derives).

0 commit comments

Comments
 (0)