Skip to content

Commit 3907dfe

Browse files
committed
mbe: Use unreachable!() for expand when we expect only expand_with_safety
1 parent 1a75cba commit 3907dfe

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

compiler/rustc_expand/src/mbe/macro_rules.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,23 +250,12 @@ impl TTMacroExpander for MacroRulesMacroExpander {
250250
impl AttrProcMacro for MacroRulesMacroExpander {
251251
fn expand(
252252
&self,
253-
cx: &mut ExtCtxt<'_>,
254-
sp: Span,
255-
args: TokenStream,
256-
body: TokenStream,
253+
_cx: &mut ExtCtxt<'_>,
254+
_sp: Span,
255+
_args: TokenStream,
256+
_body: TokenStream,
257257
) -> Result<TokenStream, ErrorGuaranteed> {
258-
expand_macro_attr(
259-
cx,
260-
sp,
261-
self.span,
262-
self.node_id,
263-
self.name,
264-
self.transparency,
265-
Safety::Default,
266-
args,
267-
body,
268-
&self.rules,
269-
)
258+
unreachable!("`expand` called on `MacroRulesMacroExpander`, expected `expand_with_safety`")
270259
}
271260

272261
fn expand_with_safety(

0 commit comments

Comments
 (0)