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

@ -99,7 +99,7 @@ pub fn find_library(name: &str, osprefix: &str, ossuffix: &str,
let oslibname = format!("{}{}{}", osprefix, name, ossuffix);
let unixlibname = format!("lib{}.a", name);
for path in search_paths.iter() {
for path in search_paths {
debug!("looking for {} inside {:?}", name, path.display());
let test = path.join(&oslibname[]);
if test.exists() { return test }
@ -244,7 +244,7 @@ impl<'a> ArchiveBuilder<'a> {
// 32,768, and we leave a bit of extra space for the program name.
static ARG_LENGTH_LIMIT: uint = 32000;
for member_name in self.members.iter() {
for member_name in &self.members {
let len = member_name.as_vec().len();
// `len + 1` to account for the space that's inserted before each
@ -297,7 +297,7 @@ impl<'a> ArchiveBuilder<'a> {
// all SYMDEF files as these are just magical placeholders which get
// re-created when we make a new archive anyway.
let files = try!(fs::readdir(loc.path()));
for file in files.iter() {
for file in &files {
let filename = file.filename_str().unwrap();
if skip(filename) { continue }
if filename.contains(".SYMDEF") { continue }

View file

@ -51,7 +51,7 @@ pub fn get_rpath_flags<F, G>(config: RPathConfig<F, G>) -> Vec<String> where
fn rpaths_to_flags(rpaths: &[String]) -> Vec<String> {
let mut ret = Vec::new();
for rpath in rpaths.iter() {
for rpath in rpaths {
ret.push(format!("-Wl,-rpath,{}", &(*rpath)[]));
}
return ret;
@ -63,7 +63,7 @@ fn get_rpaths<F, G>(mut config: RPathConfig<F, G>, libs: &[Path]) -> Vec<String>
{
debug!("output: {:?}", config.out_filename.display());
debug!("libs:");
for libpath in libs.iter() {
for libpath in libs {
debug!(" {:?}", libpath.display());
}
@ -77,7 +77,7 @@ fn get_rpaths<F, G>(mut config: RPathConfig<F, G>, libs: &[Path]) -> Vec<String>
fn log_rpaths(desc: &str, rpaths: &[String]) {
debug!("{} rpaths:", desc);
for rpath in rpaths.iter() {
for rpath in rpaths {
debug!(" {}", *rpath);
}
}
@ -138,7 +138,7 @@ fn get_install_prefix_rpath<F, G>(config: RPathConfig<F, G>) -> String where
fn minimize_rpaths(rpaths: &[String]) -> Vec<String> {
let mut set = HashSet::new();
let mut minimized = Vec::new();
for rpath in rpaths.iter() {
for rpath in rpaths {
if set.insert(&rpath[]) {
minimized.push(rpath.clone());
}

View file

@ -557,7 +557,7 @@ mod tests {
fn test_hash<D: Digest>(sh: &mut D, tests: &[Test]) {
// Test that it works when accepting the message all at once
for t in tests.iter() {
for t in tests {
sh.reset();
sh.input_str(t.input.as_slice());
let out_str = sh.result_str();
@ -565,7 +565,7 @@ mod tests {
}
// Test that it works when accepting the message in pieces
for t in tests.iter() {
for t in tests {
sh.reset();
let len = t.input.len();
let mut left = len;

View file

@ -79,7 +79,7 @@ impl Svh {
// avoid collisions.
let mut state = SipHasher::new();
for data in metadata.iter() {
for data in metadata {
data.hash(&mut state);
}
@ -97,7 +97,7 @@ impl Svh {
//
// We hash only the MetaItems instead of the entire Attribute
// to avoid hashing the AttrId
for attr in krate.attrs.iter() {
for attr in &krate.attrs {
attr.node.value.hash(&mut state);
}