Skip to content

Commit cc3c5d2

Browse files
committed
Improve name and documentation of generic_extension
This function doesn't *create* a (rules based) macro, it *expands* it. Thus, the documentation was wrong.
1 parent c6499fd commit cc3c5d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/rustc_expand/src/mbe/macro_rules.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl TTMacroExpander for MacroRulesMacroExpander {
175175
if !self.valid {
176176
return DummyResult::any(sp);
177177
}
178-
generic_extension(
178+
expand_macro(
179179
cx,
180180
sp,
181181
self.span,
@@ -202,8 +202,9 @@ fn trace_macros_note(cx_expansions: &mut FxHashMap<Span, Vec<String>>, sp: Span,
202202
cx_expansions.entry(sp).or_default().push(message);
203203
}
204204

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

0 commit comments

Comments
 (0)