diff options
Diffstat (limited to 'src/librustc_builtin_macros/concat.rs')
| -rw-r--r-- | src/librustc_builtin_macros/concat.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/librustc_builtin_macros/concat.rs b/src/librustc_builtin_macros/concat.rs index ed65611da61..4980ba0d9d3 100644 --- a/src/librustc_builtin_macros/concat.rs +++ b/src/librustc_builtin_macros/concat.rs @@ -1,7 +1,7 @@ +use rustc_ast::ast; +use rustc_ast::tokenstream::TokenStream; use rustc_expand::base::{self, DummyResult}; use rustc_span::symbol::Symbol; -use syntax::ast; -use syntax::tokenstream::TokenStream; use std::string::String; @@ -26,9 +26,12 @@ pub fn expand_concat( ast::LitKind::Char(c) => { accumulator.push(c); } - ast::LitKind::Int(i, ast::LitIntType::Unsigned(_)) - | ast::LitKind::Int(i, ast::LitIntType::Signed(_)) - | ast::LitKind::Int(i, ast::LitIntType::Unsuffixed) => { + ast::LitKind::Int( + i, + ast::LitIntType::Unsigned(_) + | ast::LitIntType::Signed(_) + | ast::LitIntType::Unsuffixed, + ) => { accumulator.push_str(&i.to_string()); } ast::LitKind::Bool(b) => { @@ -49,7 +52,7 @@ pub fn expand_concat( } } } - if missing_literal.len() > 0 { + if !missing_literal.is_empty() { let mut err = cx.struct_span_err(missing_literal, "expected a literal"); err.note("only literals (like `\"foo\"`, `42` and `3.14`) can be passed to `concat!()`"); err.emit(); |
