rustc_expand::mbe::macro_check

Function check_nested_occurrences

Source
fn check_nested_occurrences(
    psess: &ParseSess,
    node_id: NodeId,
    tts: &[TokenTree],
    macros: &Stack<'_, MacroState<'_>>,
    binders: &FxHashMap<MacroRulesNormalizedIdent, BinderInfo>,
    ops: &Stack<'_, KleeneToken>,
    guar: &mut Option<ErrorGuaranteed>,
)
Expand description

Checks tts as part of the RHS of a macro definition, tries to recognize nested macro definitions, and sets valid to false in case of errors.

Arguments:

  • psess is used to emit diagnostics and lints
  • node_id is used to emit lints
  • tts is checked as part of a RHS and may contain macro definitions
  • macros is the stack of possible outer macros
  • binders contains the binders of the associated LHS
  • ops is the stack of Kleene operators from the RHS
  • guar is set in case of errors