Type Definition rustc_resolve::macros::MacroRulesScopeRef [−][src]
pub(crate) type MacroRulesScopeRef<'a> = PtrKey<'a, Cell<MacroRulesScope<'a>>>;
Expand description
macro_rules!
scopes are always kept by reference and inside a cell.
The reason is that we update scopes with value MacroRulesScope::Invocation(invoc_id)
in-place after invoc_id
gets expanded.
This helps to avoid uncontrollable growth of macro_rules!
scope chains,
which usually grow lineraly with the number of macro invocations
in a module (including derives) and hurt performance.