diff options
Diffstat (limited to 'compiler/rustc_builtin_macros/src/concat_idents.rs')
-rw-r--r-- | compiler/rustc_builtin_macros/src/concat_idents.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_builtin_macros/src/concat_idents.rs b/compiler/rustc_builtin_macros/src/concat_idents.rs index 297c604e0..8c737f043 100644 --- a/compiler/rustc_builtin_macros/src/concat_idents.rs +++ b/compiler/rustc_builtin_macros/src/concat_idents.rs @@ -6,13 +6,15 @@ use rustc_expand::base::{self, *}; use rustc_span::symbol::{Ident, Symbol}; use rustc_span::Span; +use crate::errors; + pub fn expand_concat_idents<'cx>( cx: &'cx mut ExtCtxt<'_>, sp: Span, tts: TokenStream, ) -> Box<dyn base::MacResult + 'cx> { if tts.is_empty() { - cx.span_err(sp, "concat_idents! takes 1 or more arguments"); + cx.emit_err(errors::ConcatIdentsMissingArgs { span: sp }); return DummyResult::any(sp); } @@ -22,7 +24,7 @@ pub fn expand_concat_idents<'cx>( match e { TokenTree::Token(Token { kind: token::Comma, .. }, _) => {} _ => { - cx.span_err(sp, "concat_idents! expecting comma"); + cx.emit_err(errors::ConcatIdentsMissingComma { span: sp }); return DummyResult::any(sp); } } @@ -34,7 +36,7 @@ pub fn expand_concat_idents<'cx>( } } - cx.span_err(sp, "concat_idents! requires ident args"); + cx.emit_err(errors::ConcatIdentsIdentArgs { span: sp }); return DummyResult::any(sp); } } |