diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-15 14:34:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-15 14:34:10 +0200 |
| commit | 6e8fabb4ac16b30c98968b768b860d2c2e1583d8 (patch) | |
| tree | 97262d6fe68846bffd0ebdb303403b4da9ed4ee1 /src/libsyntax_ext/assert.rs | |
| parent | 19d6178b8f44a8bee56b45df07116a6d490eb7d1 (diff) | |
| parent | a6182711efe32d4dd68da2663129e3e2e462d8cb (diff) | |
| download | rust-6e8fabb4ac16b30c98968b768b860d2c2e1583d8.tar.gz rust-6e8fabb4ac16b30c98968b768b860d2c2e1583d8.zip | |
Rollup merge of #63586 - petrochenkov:nospanned, r=eddyb
cleanup: Remove `Spanned` where possible It generally only makes sense on enums, otherwise it's more convenient to "flatten" it by adding a span field to the struct it wraps.
Diffstat (limited to 'src/libsyntax_ext/assert.rs')
| -rw-r--r-- | src/libsyntax_ext/assert.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libsyntax_ext/assert.rs b/src/libsyntax_ext/assert.rs index e3ef39075e2..6301283460a 100644 --- a/src/libsyntax_ext/assert.rs +++ b/src/libsyntax_ext/assert.rs @@ -1,7 +1,6 @@ use errors::{Applicability, DiagnosticBuilder}; use syntax::ast::{self, *}; -use syntax::source_map::Spanned; use syntax::ext::base::*; use syntax::parse::token::{self, TokenKind}; use syntax::parse::parser::Parser; @@ -25,7 +24,7 @@ pub fn expand_assert<'cx>( }; let sp = sp.apply_mark(cx.current_expansion.id); - let panic_call = Mac_ { + let panic_call = Mac { path: Path::from_ident(Ident::new(sym::panic, sp)), tts: custom_message.unwrap_or_else(|| { TokenStream::from(TokenTree::token( @@ -37,6 +36,7 @@ pub fn expand_assert<'cx>( )) }).into(), delim: MacDelimiter::Parenthesis, + span: sp, prior_type_ascription: None, }; let if_expr = cx.expr_if( @@ -44,10 +44,7 @@ pub fn expand_assert<'cx>( cx.expr(sp, ExprKind::Unary(UnOp::Not, cond_expr)), cx.expr( sp, - ExprKind::Mac(Spanned { - span: sp, - node: panic_call, - }), + ExprKind::Mac(panic_call), ), None, ); |
