1
Fork 0

Replace full slice notation with index calls

This commit is contained in:
Nick Cameron 2015-01-02 13:56:28 +13:00
parent 918255ef8c
commit f7ff37e4c5
225 changed files with 2166 additions and 2139 deletions

View file

@ -58,7 +58,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
Some(previous_span) => {
ecx.span_warn(span, format!(
"diagnostic code {} already used", token::get_ident(code).get()
)[]);
).index(&FullRange));
ecx.span_note(previous_span, "previous invocation");
},
None => ()
@ -87,12 +87,12 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
if diagnostics.insert(code.name, description).is_some() {
ecx.span_err(span, format!(
"diagnostic code {} already registered", token::get_ident(*code).get()
)[]);
).index(&FullRange));
}
});
let sym = Ident::new(token::gensym((
"__register_diagnostic_".to_string() + token::get_ident(*code).get()
)[]));
).index(&FullRange)));
MacItems::new(vec![quote_item!(ecx, mod $sym {}).unwrap()].into_iter())
}