diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-02 11:01:12 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-02 11:01:12 -0800 |
| commit | 7335c7dd63cafe70ffca76677f9e33bc6eccefaa (patch) | |
| tree | 3646a5159f74b47d8bdf471eff072ea71f395d82 /src/libstd/sys | |
| parent | 075588a4939acb47feea79779a9bdacce702d9c5 (diff) | |
| parent | 3484706c38272828efc50b2553578afc62230dbb (diff) | |
| download | rust-7335c7dd63cafe70ffca76677f9e33bc6eccefaa.tar.gz rust-7335c7dd63cafe70ffca76677f9e33bc6eccefaa.zip | |
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
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/common/net.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/common/wtf8.rs | 13 | ||||
| -rw-r--r-- | src/libstd/sys/unix/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/windows/thread_local.rs | 2 |
5 files changed, 8 insertions, 19 deletions
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index c826522e5d1..833de8adda4 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -554,7 +554,7 @@ pub fn await(fds: &[sock_t], deadline: Option<u64>, status: SocketStatus) -> IoResult<()> { let mut set: c::fd_set = unsafe { mem::zeroed() }; let mut max = 0; - for &fd in fds.iter() { + for &fd in fds { c::fd_set(&mut set, fd); max = cmp::max(max, fd + 1); } diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index fdcb0c19f30..b30af10986b 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -366,7 +366,7 @@ impl FromIterator<CodePoint> for Wtf8Buf { /// This replaces surrogate code point pairs with supplementary code points, /// like concatenating ill-formed UTF-16 strings effectively would. impl Extend<CodePoint> for Wtf8Buf { - fn extend<T: Iterator<Item=CodePoint>>(&mut self, mut iterator: T) { + fn extend<T: Iterator<Item=CodePoint>>(&mut self, iterator: T) { let (low, _high) = iterator.size_hint(); // Lower bound of one byte per code point (ASCII only) self.bytes.reserve(low); @@ -680,17 +680,6 @@ impl ops::Index<ops::RangeTo<usize>> for Wtf8 { } } -#[cfg(stage0)] -impl ops::Index<ops::FullRange> for Wtf8 { - type Output = Wtf8; - - #[inline] - fn index(&self, _range: &ops::FullRange) -> &Wtf8 { - self - } -} - -#[cfg(not(stage0))] impl ops::Index<ops::RangeFull> for Wtf8 { type Output = Wtf8; diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 7618e1990f3..7e117b10a34 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -558,7 +558,7 @@ fn with_envp<K,V,T,F>(env: Option<&HashMap<K, V>>, Some(env) => { let mut tmps = Vec::with_capacity(env.len()); - for pair in env.iter() { + for pair in env { let mut kv = Vec::new(); kv.push_all(pair.0.container_as_bytes()); kv.push('=' as u8); diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 043fdb38805..3ca735f7fdf 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -142,12 +142,12 @@ impl Process { // To have the spawning semantics of unix/windows stay the same, we need to // read the *child's* PATH if one is provided. See #15149 for more details. let program = cfg.env().and_then(|env| { - for (key, v) in env.iter() { + for (key, v) in env { if b"PATH" != key.container_as_bytes() { continue } // Split the value and test each path to see if the // program exists. - for path in os::split_paths(v.container_as_bytes()).into_iter() { + for path in os::split_paths(v.container_as_bytes()) { let path = path.join(cfg.program().as_bytes()) .with_extension(env::consts::EXE_EXTENSION); if path.exists() { @@ -372,7 +372,7 @@ fn make_command_line(prog: &CString, args: &[CString]) -> String { let mut cmd = String::new(); append_arg(&mut cmd, str::from_utf8(prog.as_bytes()).ok() .expect("expected program name to be utf-8 encoded")); - for arg in args.iter() { + for arg in args { cmd.push(' '); append_arg(&mut cmd, str::from_utf8(arg.as_bytes()).ok() .expect("expected argument to be utf-8 encoded")); @@ -437,7 +437,7 @@ fn with_envp<K, V, T, F>(env: Option<&collections::HashMap<K, V>>, cb: F) -> T Some(env) => { let mut blk = Vec::new(); - for pair in env.iter() { + for pair in env { let kv = format!("{}={}", pair.0.container_as_str().unwrap(), pair.1.container_as_str().unwrap()); diff --git a/src/libstd/sys/windows/thread_local.rs b/src/libstd/sys/windows/thread_local.rs index cc731738afe..54a32e43daf 100644 --- a/src/libstd/sys/windows/thread_local.rs +++ b/src/libstd/sys/windows/thread_local.rs @@ -249,7 +249,7 @@ unsafe fn run_dtors() { DTOR_LOCK.unlock(); ret }; - for &(key, dtor) in dtors.iter() { + for &(key, dtor) in &dtors { let ptr = TlsGetValue(key); if !ptr.is_null() { TlsSetValue(key, ptr::null_mut()); |
