diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ascii.rs | 26 | ||||
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 6 | ||||
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 4 | ||||
| -rw-r--r-- | src/libstd/old_path/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/os.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/common/thread_info.rs | 4 | ||||
| -rw-r--r-- | src/libstd/thread.rs | 5 |
7 files changed, 20 insertions, 31 deletions
diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 892747e79ed..ac48481027d 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -338,7 +338,6 @@ mod tests { assert!("".is_ascii()); assert!("a".is_ascii()); assert!(!"\u{2009}".is_ascii()); - } #[test] @@ -346,13 +345,11 @@ mod tests { assert_eq!("url()URL()uRl()ürl".to_ascii_uppercase(), "URL()URL()URL()üRL"); assert_eq!("hıKß".to_ascii_uppercase(), "HıKß"); - let mut i = 0; - while i <= 500 { + for i in 0u32..501 { let upper = if 'a' as u32 <= i && i <= 'z' as u32 { i + 'A' as u32 - 'a' as u32 } else { i }; assert_eq!((from_u32(i).unwrap()).to_string().to_ascii_uppercase(), (from_u32(upper).unwrap()).to_string()); - i += 1; } } @@ -362,13 +359,11 @@ mod tests { // Dotted capital I, Kelvin sign, Sharp S. assert_eq!("HİKß".to_ascii_lowercase(), "hİKß"); - let mut i = 0; - while i <= 500 { + for i in 0u32..501 { let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 } else { i }; assert_eq!((from_u32(i).unwrap()).to_string().to_ascii_lowercase(), (from_u32(lower).unwrap()).to_string()); - i += 1; } } @@ -378,13 +373,11 @@ mod tests { "URL()URL()URL()üRL".to_string()); assert_eq!(("hıKß".to_string()).into_ascii_uppercase(), "HıKß"); - let mut i = 0; - while i <= 500 { + for i in 0u32..501 { let upper = if 'a' as u32 <= i && i <= 'z' as u32 { i + 'A' as u32 - 'a' as u32 } else { i }; assert_eq!((from_u32(i).unwrap()).to_string().into_ascii_uppercase(), (from_u32(upper).unwrap()).to_string()); - i += 1; } } @@ -395,13 +388,11 @@ mod tests { // Dotted capital I, Kelvin sign, Sharp S. assert_eq!(("HİKß".to_string()).into_ascii_lowercase(), "hİKß"); - let mut i = 0; - while i <= 500 { + for i in 0u32..501 { let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 } else { i }; assert_eq!((from_u32(i).unwrap()).to_string().into_ascii_lowercase(), (from_u32(lower).unwrap()).to_string()); - i += 1; } } @@ -415,14 +406,11 @@ mod tests { assert!(!"K".eq_ignore_ascii_case("k")); assert!(!"ß".eq_ignore_ascii_case("s")); - let mut i = 0; - while i <= 500 { - let c = i; - let lower = if 'A' as u32 <= c && c <= 'Z' as u32 { c + 'a' as u32 - 'A' as u32 } - else { c }; + for i in 0u32..501 { + let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 } + else { i }; assert!((from_u32(i).unwrap()).to_string().eq_ignore_ascii_case( &from_u32(lower).unwrap().to_string())); - i += 1; } } } diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 710f021d912..18dd122891d 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1377,7 +1377,7 @@ impl<'a, K, V, S, H> IntoIterator for &'a HashMap<K, V, S> S: HashState<Hasher=H>, H: hash::Hasher<Output=u64> { - type Iter = Iter<'a, K, V>; + type IntoIter = Iter<'a, K, V>; fn into_iter(self) -> Iter<'a, K, V> { self.iter() @@ -1389,7 +1389,7 @@ impl<'a, K, V, S, H> IntoIterator for &'a mut HashMap<K, V, S> S: HashState<Hasher=H>, H: hash::Hasher<Output=u64> { - type Iter = IterMut<'a, K, V>; + type IntoIter = IterMut<'a, K, V>; fn into_iter(mut self) -> IterMut<'a, K, V> { self.iter_mut() @@ -1401,7 +1401,7 @@ impl<K, V, S, H> IntoIterator for HashMap<K, V, S> S: HashState<Hasher=H>, H: hash::Hasher<Output=u64> { - type Iter = IntoIter<K, V>; + type IntoIter = IntoIter<K, V>; fn into_iter(self) -> IntoIter<K, V> { self.into_iter() diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index e40f17f29e8..de3c0424c9a 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -840,7 +840,7 @@ impl<'a, T, S, H> IntoIterator for &'a HashSet<T, S> S: HashState<Hasher=H>, H: hash::Hasher<Output=u64> { - type Iter = Iter<'a, T>; + type IntoIter = Iter<'a, T>; fn into_iter(self) -> Iter<'a, T> { self.iter() @@ -852,7 +852,7 @@ impl<T, S, H> IntoIterator for HashSet<T, S> S: HashState<Hasher=H>, H: hash::Hasher<Output=u64> { - type Iter = IntoIter<T>; + type IntoIter = IntoIter<T>; fn into_iter(self) -> IntoIter<T> { self.into_iter() diff --git a/src/libstd/old_path/mod.rs b/src/libstd/old_path/mod.rs index 0d80258d7e0..17cfe1c8297 100644 --- a/src/libstd/old_path/mod.rs +++ b/src/libstd/old_path/mod.rs @@ -228,7 +228,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// ``` fn into_vec(self) -> Vec<u8>; - /// Returns an object that implements `Show` for printing paths + /// Returns an object that implements `Display` for printing paths /// /// # Example /// @@ -244,7 +244,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { Display{ path: self, filename: false } } - /// Returns an object that implements `Show` for printing filenames + /// Returns an object that implements `Display` for printing filenames /// /// If there is no filename, nothing will be printed. /// diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 1a617694456..526b5edd4cb 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -723,7 +723,7 @@ extern "system" { /// println!("{}", argument); /// } /// ``` -#[deprecated(since = "1.0.0", reason = "use env::args instead")] +#[deprecated(since = "1.0.0", reason = "use std::env::args() instead")] #[unstable(feature = "os")] pub fn args() -> Vec<String> { real_args() diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs index ce67a584a0a..92b936e74f6 100644 --- a/src/libstd/sys/common/thread_info.rs +++ b/src/libstd/sys/common/thread_info.rs @@ -56,10 +56,6 @@ pub fn stack_guard() -> uint { pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) { THREAD_INFO.with(|c| assert!(c.borrow().is_none())); - match thread.name() { - Some(name) => unsafe { ::sys::thread::set_name(name); }, - None => {} - } THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{ stack_bounds: stack_bounds, stack_guard: stack_guard, diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index eb967c9f4e3..cc9d7492441 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -156,6 +156,7 @@ use ops::{Drop, FnOnce}; use option::Option::{self, Some, None}; use result::Result::{Err, Ok}; use sync::{Mutex, Condvar, Arc}; +use str::Str; use string::String; use rt::{self, unwind}; use old_io::{Writer, stdio}; @@ -280,6 +281,10 @@ impl Builder { unsafe { stack::record_os_managed_stack_bounds(my_stack_bottom, my_stack_top); } + match their_thread.name() { + Some(name) => unsafe { imp::set_name(name.as_slice()); }, + None => {} + } thread_info::set( (my_stack_bottom, my_stack_top), unsafe { imp::guard::current() }, |
