File tree 1 file changed +5
-7
lines changed
compiler/rustc_builtin_macros/src
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -12,25 +12,23 @@ use rustc_span::{Span, DUMMY_SP};
12
12
13
13
pub fn expand_assert < ' cx > (
14
14
cx : & ' cx mut ExtCtxt < ' _ > ,
15
- sp : Span ,
15
+ span : Span ,
16
16
tts : TokenStream ,
17
17
) -> Box < dyn MacResult + ' cx > {
18
- let Assert { cond_expr, custom_message } = match parse_assert ( cx, sp , tts) {
18
+ let Assert { cond_expr, custom_message } = match parse_assert ( cx, span , tts) {
19
19
Ok ( assert) => assert,
20
20
Err ( mut err) => {
21
21
err. emit ( ) ;
22
- return DummyResult :: any ( sp ) ;
22
+ return DummyResult :: any ( span ) ;
23
23
}
24
24
} ;
25
25
26
- let is_2021 = sp. rust_2021 ( ) ;
27
-
28
26
// `core::panic` and `std::panic` are different macros, so we use call-site
29
27
// context to pick up whichever is currently in scope.
30
- let sp = cx. with_call_site_ctxt ( sp ) ;
28
+ let sp = cx. with_call_site_ctxt ( span ) ;
31
29
32
30
let panic_call = if let Some ( tokens) = custom_message {
33
- let path = if is_2021 {
31
+ let path = if span . rust_2021 ( ) {
34
32
// On edition 2021, we always call `$crate::panic!()`.
35
33
Path {
36
34
span : sp,
You can’t perform that action at this time.
0 commit comments