Skip to content

Commit e890c3b

Browse files
committed
Use helper methods when possible
1 parent 19bfe0a commit e890c3b

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

compiler/rustc_builtin_macros/src/edition_panic.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_ast::token::{Delimiter, Lit, LitKind, TokenKind};
2-
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
2+
use rustc_ast::tokenstream::{TokenStream, TokenTree};
33
use rustc_ast::*;
44
use rustc_expand::base::*;
55
use rustc_span::edition::Edition;
@@ -117,24 +117,22 @@ fn expand<'cx>(
117117
}
118118

119119
ExpandResult::Ready(MacEager::expr(
120-
cx.expr(
120+
cx.expr_macro_call(
121121
sp,
122-
ExprKind::MacCall(Box::new(MacCall {
123-
path: Path {
122+
cx.macro_call(
123+
sp,
124+
Path {
124125
span: sp,
125126
segments: cx
126127
.std_path(&[sym::panic, mac.symbol()])
127128
.into_iter()
128-
.map(|ident| PathSegment::from_ident(ident))
129+
.map(PathSegment::from_ident)
129130
.collect(),
130131
tokens: None,
131132
},
132-
args: Box::new(DelimArgs {
133-
dspan: DelimSpan::from_single(sp),
134-
delim: Delimiter::Parenthesis,
135-
tokens: tts,
136-
}),
137-
})),
133+
Delimiter::Parenthesis,
134+
tts,
135+
),
138136
),
139137
))
140138
}

0 commit comments

Comments
 (0)