Skip to content

Commit 2335d05

Browse files
Put Macros inside of the ResolverArena
1 parent f838cbc commit 2335d05

File tree

1 file changed

+16
-0
lines changed
  • compiler/rustc_resolve/src

1 file changed

+16
-0
lines changed

compiler/rustc_resolve/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,21 @@ impl MacroData {
10251025
}
10261026
}
10271027

1028+
pub(crate) type Macro<'ra> = Interned<'ra, MacroData>;
1029+
1030+
// Allows us to use Interned without actually enforcing (via Hash/PartialEq/...) uniqueness of the
1031+
// contained data.
1032+
// FIXME: We may wish to actually have at least debug-level assertions that Interned's guarantees
1033+
// are upheld.
1034+
impl std::hash::Hash for MacroData {
1035+
fn hash<H>(&self, _: &mut H)
1036+
where
1037+
H: std::hash::Hasher,
1038+
{
1039+
unreachable!()
1040+
}
1041+
}
1042+
10281043
/// The main resolver class.
10291044
///
10301045
/// This is the visitor that walks the whole crate.
@@ -1241,6 +1256,7 @@ pub struct ResolverArenas<'ra> {
12411256
imports: TypedArena<ImportData<'ra>>,
12421257
name_resolutions: TypedArena<RefCell<NameResolution<'ra>>>,
12431258
ast_paths: TypedArena<ast::Path>,
1259+
macros: TypedArena<MacroData>,
12441260
dropless: DroplessArena,
12451261
}
12461262

0 commit comments

Comments
 (0)