rustc_resolve::macros

Type Alias MacroRulesScopeRef

source
pub(crate) type MacroRulesScopeRef<'ra> = Interned<'ra, Cell<MacroRulesScope<'ra>>>;
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 linearly with the number of macro invocations in a module (including derives) and hurt performance.

Aliased Type§

struct MacroRulesScopeRef<'ra>(pub &'ra Cell<MacroRulesScope<'ra>>, pub PrivateZst);

Fields§

§0: &'ra Cell<MacroRulesScope<'ra>>§1: PrivateZst

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 8 bytes