diff options
| author | bors <bors@rust-lang.org> | 2015-02-07 02:04:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-07 02:04:47 +0000 |
| commit | 7ebf9bc5c22155d622537ded42b4ebf94238b296 (patch) | |
| tree | b3f937f2f554e961236d3a2048778441ab062c5e /src/libsyntax/diagnostics/plugin.rs | |
| parent | d3732a12e896ab98aa27eaffab99a78bbaf837e4 (diff) | |
| parent | a2e01c62d5b6259d55b6688c8b059ac28e5dd03e (diff) | |
| download | rust-7ebf9bc5c22155d622537ded42b4ebf94238b296.tar.gz rust-7ebf9bc5c22155d622537ded42b4ebf94238b296.zip | |
Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichton
It's in order to make the code more homogeneous.
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
| -rw-r--r-- | src/libsyntax/diagnostics/plugin.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs index bd5247bbad6..833a6d52acb 100644 --- a/src/libsyntax/diagnostics/plugin.rs +++ b/src/libsyntax/diagnostics/plugin.rs @@ -10,6 +10,7 @@ use std::cell::RefCell; use std::collections::BTreeMap; + use ast; use ast::{Ident, Name, TokenTree}; use codemap::Span; @@ -57,7 +58,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt, match diagnostics.insert(code.name, span) { Some(previous_span) => { ecx.span_warn(span, &format!( - "diagnostic code {} already used", token::get_ident(code).get() + "diagnostic code {} already used", &token::get_ident(code) )[]); ecx.span_note(previous_span, "previous invocation"); }, @@ -68,7 +69,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt, with_registered_diagnostics(|diagnostics| { if !diagnostics.contains_key(&code.name) { ecx.span_err(span, &format!( - "used diagnostic code {} not registered", token::get_ident(code).get() + "used diagnostic code {} not registered", &token::get_ident(code) )[]); } }); @@ -93,12 +94,12 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt, with_registered_diagnostics(|diagnostics| { if diagnostics.insert(code.name, description).is_some() { ecx.span_err(span, &format!( - "diagnostic code {} already registered", token::get_ident(*code).get() + "diagnostic code {} already registered", &token::get_ident(*code) )[]); } }); let sym = Ident::new(token::gensym(&( - "__register_diagnostic_".to_string() + token::get_ident(*code).get() + "__register_diagnostic_".to_string() + &token::get_ident(*code) )[])); MacItems::new(vec![quote_item!(ecx, mod $sym {}).unwrap()].into_iter()) } |
