Fallout of std::str stabilization

This commit is contained in:
Alex Crichton
2014-12-10 19:46:38 -08:00
parent 4908017d59
commit 082bfde412
193 changed files with 2143 additions and 2230 deletions

View File

@@ -549,7 +549,7 @@ impl<'a> ExtCtxt<'a> {
pub fn mod_pop(&mut self) { self.mod_path.pop().unwrap(); }
pub fn mod_path(&self) -> Vec<ast::Ident> {
let mut v = Vec::new();
v.push(token::str_to_ident(self.ecfg.crate_name.as_slice()));
v.push(token::str_to_ident(self.ecfg.crate_name[]));
v.extend(self.mod_path.iter().map(|a| *a));
return v;
}
@@ -558,7 +558,7 @@ impl<'a> ExtCtxt<'a> {
if self.recursion_count > self.ecfg.recursion_limit {
self.span_fatal(ei.call_site,
format!("recursion limit reached while expanding the macro `{}`",
ei.callee.name).as_slice());
ei.callee.name)[]);
}
let mut call_site = ei.call_site;
@@ -669,7 +669,7 @@ pub fn check_zero_tts(cx: &ExtCtxt,
tts: &[ast::TokenTree],
name: &str) {
if tts.len() != 0 {
cx.span_err(sp, format!("{} takes no arguments", name).as_slice());
cx.span_err(sp, format!("{} takes no arguments", name)[]);
}
}
@@ -682,12 +682,12 @@ pub fn get_single_str_from_tts(cx: &mut ExtCtxt,
-> Option<String> {
let mut p = cx.new_parser_from_tts(tts);
if p.token == token::Eof {
cx.span_err(sp, format!("{} takes 1 argument", name).as_slice());
cx.span_err(sp, format!("{} takes 1 argument", name)[]);
return None
}
let ret = cx.expander().fold_expr(p.parse_expr());
if p.token != token::Eof {
cx.span_err(sp, format!("{} takes 1 argument", name).as_slice());
cx.span_err(sp, format!("{} takes 1 argument", name)[]);
}
expr_to_string(cx, ret, "argument must be a string literal").map(|(s, _)| {
s.get().to_string()