1
Fork 0

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

@ -40,7 +40,7 @@ pub fn maybe_inject_prelude(krate: ast::Crate) -> ast::Crate {
}
fn use_std(krate: &ast::Crate) -> bool {
!attr::contains_name(krate.attrs.as_slice(), "no_std")
!attr::contains_name(krate.attrs[], "no_std")
}
fn no_prelude(attrs: &[ast::Attribute]) -> bool {
@ -56,7 +56,7 @@ impl<'a> fold::Folder for StandardLibraryInjector<'a> {
// The name to use in `extern crate "name" as std;`
let actual_crate_name = match self.alt_std_name {
Some(ref s) => token::intern_and_get_ident(s.as_slice()),
Some(ref s) => token::intern_and_get_ident(s[]),
None => token::intern_and_get_ident("std"),
};
@ -118,7 +118,7 @@ impl<'a> fold::Folder for PreludeInjector<'a> {
attr::mark_used(&no_std_attr);
krate.attrs.push(no_std_attr);
if !no_prelude(krate.attrs.as_slice()) {
if !no_prelude(krate.attrs[]) {
// only add `use std::prelude::*;` if there wasn't a
// `#![no_implicit_prelude]` at the crate level.
// fold_mod() will insert glob path.
@ -138,7 +138,7 @@ impl<'a> fold::Folder for PreludeInjector<'a> {
}
fn fold_item(&mut self, item: P<ast::Item>) -> SmallVector<P<ast::Item>> {
if !no_prelude(item.attrs.as_slice()) {
if !no_prelude(item.attrs[]) {
// only recur if there wasn't `#![no_implicit_prelude]`
// on this item, i.e. this means that the prelude is not
// implicitly imported though the whole subtree