Skip to content

Commit 4df32ed

Browse files
use normal reverence for MacroRulesScopeRef instead of Interned
1 parent 7084072 commit 4df32ed

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
@@ -1292,7 +1292,7 @@ impl<'ra> ResolverArenas<'ra> {
12921292
self.name_resolutions.alloc(Default::default())
12931293
}
12941294
fn alloc_macro_rules_scope(&'ra self, scope: MacroRulesScope<'ra>) -> MacroRulesScopeRef<'ra> {
1295-
Interned::new_unchecked(self.dropless.alloc(Cell::new(scope)))
1295+
self.dropless.alloc(Cell::new(scope))
12961296
}
12971297
fn alloc_macro_rules_binding(
12981298
&'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)