rollup merge of #21830: japaric/for-cleanup

Conflicts:
	src/librustc/metadata/filesearch.rs
	src/librustc_back/target/mod.rs
	src/libstd/os.rs
	src/libstd/sys/windows/os.rs
	src/libsyntax/ext/tt/macro_parser.rs
	src/libsyntax/print/pprust.rs
	src/test/compile-fail/issue-2149.rs
This commit is contained in:
Alex Crichton 2015-02-02 11:01:12 -08:00
commit 7335c7dd63
319 changed files with 1308 additions and 1443 deletions

View file

@ -48,7 +48,7 @@ pub fn find_plugin_registrar(diagnostic: &diagnostic::SpanHandler,
},
_ => {
diagnostic.handler().err("multiple plugin registration functions found");
for &(_, span) in finder.registrars.iter() {
for &(_, span) in &finder.registrars {
diagnostic.span_note(span, "one is here");
}
diagnostic.handler().abort_if_errors();

View file

@ -73,7 +73,7 @@ pub fn load_plugins(sess: &Session, krate: &ast::Crate,
// We need to error on `#[macro_use] extern crate` when it isn't at the
// crate root, because `$crate` won't work properly. Identify these by
// spans, because the crate map isn't set up yet.
for item in krate.module.items.iter() {
for item in &krate.module.items {
if let ast::ItemExternCrate(_) = item.node {
loader.span_whitelist.insert(item.span);
}
@ -82,7 +82,7 @@ pub fn load_plugins(sess: &Session, krate: &ast::Crate,
visit::walk_crate(&mut loader, krate);
if let Some(plugins) = addl_plugins {
for plugin in plugins.iter() {
for plugin in &plugins {
loader.load_plugin(CrateOrString::Str(plugin.as_slice()),
None, None, None)
}
@ -107,7 +107,7 @@ impl<'a, 'v> Visitor<'v> for PluginLoader<'a> {
let mut plugin_attr = None;
let mut macro_selection = Some(HashSet::new()); // None => load all
let mut reexport = HashSet::new();
for attr in item.attrs.iter() {
for attr in &item.attrs {
let mut used = true;
match attr.name().get() {
"phase" => {
@ -127,7 +127,7 @@ impl<'a, 'v> Visitor<'v> for PluginLoader<'a> {
macro_selection = None;
}
if let (Some(sel), Some(names)) = (macro_selection.as_mut(), names) {
for name in names.iter() {
for name in names {
if let ast::MetaWord(ref name) = name.node {
sel.insert(name.clone());
} else {
@ -145,7 +145,7 @@ impl<'a, 'v> Visitor<'v> for PluginLoader<'a> {
}
};
for name in names.iter() {
for name in names {
if let ast::MetaWord(ref name) = name.node {
reexport.insert(name.clone());
} else {
@ -204,7 +204,7 @@ impl<'a> PluginLoader<'a> {
}
}
for mut def in macros.into_iter() {
for mut def in macros {
let name = token::get_ident(def.ident);
def.use_locally = match macro_selection.as_ref() {
None => true,