Remove Spanned from ast::Mac

This commit is contained in:
Vadim Petrochenkov
2019-08-15 02:13:53 +03:00
parent 73d2da0894
commit 433b1e36e1
17 changed files with 54 additions and 52 deletions

View File

@@ -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,
);