Skip to content

Commit

Permalink
Improve name and documentation of generic_extension
Browse files Browse the repository at this point in the history
This function doesn't *create* a (rules based) macro, it *expands* it.
Thus, the documentation was wrong.
  • Loading branch information
est31 committed May 13, 2022
1 parent c6499fd commit cc3c5d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/rustc_expand/src/mbe/macro_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl TTMacroExpander for MacroRulesMacroExpander {
if !self.valid {
return DummyResult::any(sp);
}
generic_extension(
expand_macro(
cx,
sp,
self.span,
Expand All @@ -202,8 +202,9 @@ fn trace_macros_note(cx_expansions: &mut FxHashMap<Span, Vec<String>>, sp: Span,
cx_expansions.entry(sp).or_default().push(message);
}

/// Given `lhses` and `rhses`, this is the new macro we create
fn generic_extension<'cx, 'tt>(
/// Expands the rules based macro defined by `lhses` and `rhses` for a given
/// input `arg`.
fn expand_macro<'cx, 'tt>(
cx: &'cx mut ExtCtxt<'_>,
sp: Span,
def_span: Span,
Expand Down

0 comments on commit cc3c5d2

Please sign in to comment.