File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
compiler/rustc_builtin_macros/src Expand file tree Collapse file tree 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};
1212
1313pub fn expand_assert < ' cx > (
1414 cx : & ' cx mut ExtCtxt < ' _ > ,
15- sp : Span ,
15+ span : Span ,
1616 tts : TokenStream ,
1717) -> 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) {
1919 Ok ( assert) => assert,
2020 Err ( mut err) => {
2121 err. emit ( ) ;
22- return DummyResult :: any ( sp ) ;
22+ return DummyResult :: any ( span ) ;
2323 }
2424 } ;
2525
26- let is_2021 = sp. rust_2021 ( ) ;
27-
2826 // `core::panic` and `std::panic` are different macros, so we use call-site
2927 // 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 ) ;
3129
3230 let panic_call = if let Some ( tokens) = custom_message {
33- let path = if is_2021 {
31+ let path = if span . rust_2021 ( ) {
3432 // On edition 2021, we always call `$crate::panic!()`.
3533 Path {
3634 span : sp,
You can’t perform that action at this time.
0 commit comments