about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-16 00:46:43 +0000
committerbors <bors@rust-lang.org>2015-02-16 00:46:43 +0000
commitc5db290bf6df986a6acd5ce993f278c18e55ca37 (patch)
tree5a67ed2bb3601bc1d5f477057324421fbd2291c3 /src/libstd
parent342ab53bf858a89e418973ba3bfff55161c0b174 (diff)
parentcea2bbfe27707becaacad1ce64b835b408c0ccf8 (diff)
downloadrust-c5db290bf6df986a6acd5ce993f278c18e55ca37.tar.gz
rust-c5db290bf6df986a6acd5ce993f278c18e55ca37.zip
Auto merge of #22367 - Manishearth:rollup, r=steveklabnik
(still testing locally)
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ascii.rs4
-rw-r--r--src/libstd/ffi/os_str.rs2
-rw-r--r--src/libstd/lib.rs2
-rw-r--r--src/libstd/num/f32.rs15
-rw-r--r--src/libstd/num/f64.rs15
-rw-r--r--src/libstd/num/strconv.rs14
-rw-r--r--src/libstd/old_io/net/udp.rs1
-rw-r--r--src/libstd/old_io/stdio.rs2
-rw-r--r--src/libstd/panicking.rs (renamed from src/libstd/failure.rs)2
-rwxr-xr-xsrc/libstd/path.rs1
-rw-r--r--src/libstd/rt/unwind.rs6
-rw-r--r--src/libstd/sync/mpsc/mod.rs16
-rw-r--r--src/libstd/sync/mpsc/select.rs15
13 files changed, 52 insertions, 43 deletions
diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs
index ac48481027d..0a3abd5d1ac 100644
--- a/src/libstd/ascii.rs
+++ b/src/libstd/ascii.rs
@@ -159,12 +159,12 @@ impl AsciiExt for u8 {
 
     #[inline]
     fn to_ascii_uppercase(&self) -> u8 {
-        ASCII_UPPERCASE_MAP[*self as uint]
+        ASCII_UPPERCASE_MAP[*self as usize]
     }
 
     #[inline]
     fn to_ascii_lowercase(&self) -> u8 {
-        ASCII_LOWERCASE_MAP[*self as uint]
+        ASCII_LOWERCASE_MAP[*self as usize]
     }
 
     #[inline]
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index 4d7292b6eb4..1d14b141778 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -189,7 +189,7 @@ impl OsStr {
         self.inner.to_string_lossy()
     }
 
-    /// Copy the slice into an onwed `OsString`.
+    /// Copy the slice into an owned `OsString`.
     pub fn to_os_string(&self) -> OsString {
         OsString { inner: self.inner.to_owned() }
     }
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index e6ca1bfdb81..139693ccdbc 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -279,7 +279,7 @@ pub mod sync;
 #[path = "sys/common/mod.rs"] mod sys_common;
 
 pub mod rt;
-mod failure;
+mod panicking;
 
 // Documentation for primitive types
 
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs
index 58b93665fe1..7d15a16309e 100644
--- a/src/libstd/num/f32.rs
+++ b/src/libstd/num/f32.rs
@@ -30,6 +30,7 @@ use core::num;
 pub use core::f32::{RADIX, MANTISSA_DIGITS, DIGITS, EPSILON, MIN_VALUE};
 pub use core::f32::{MIN_POS_VALUE, MAX_VALUE, MIN_EXP, MAX_EXP, MIN_10_EXP};
 pub use core::f32::{MAX_10_EXP, NAN, INFINITY, NEG_INFINITY};
+pub use core::f32::{MIN, MIN_POSITIVE, MAX};
 pub use core::f32::consts;
 
 #[allow(dead_code)]
@@ -369,7 +370,7 @@ impl Float for f32 {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_string(num: f32) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigAll, ExpNone, false);
+        num, 10, true, SignNeg, DigAll, ExpNone, false);
     r
 }
 
@@ -382,7 +383,7 @@ pub fn to_string(num: f32) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_hex(num: f32) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 16u, true, SignNeg, DigAll, ExpNone, false);
+        num, 16, true, SignNeg, DigAll, ExpNone, false);
     r
 }
 
@@ -395,7 +396,7 @@ pub fn to_str_hex(num: f32) -> String {
 /// * radix - The base to use
 #[inline]
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
-pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) {
+pub fn to_str_radix_special(num: f32, rdx: u32) -> (String, bool) {
     strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false)
 }
 
@@ -410,7 +411,7 @@ pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_exact(num: f32, dig: uint) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigExact(dig), ExpNone, false);
+        num, 10, true, SignNeg, DigExact(dig), ExpNone, false);
     r
 }
 
@@ -425,7 +426,7 @@ pub fn to_str_exact(num: f32, dig: uint) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_digits(num: f32, dig: uint) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigMax(dig), ExpNone, false);
+        num, 10, true, SignNeg, DigMax(dig), ExpNone, false);
     r
 }
 
@@ -441,7 +442,7 @@ pub fn to_str_digits(num: f32, dig: uint) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper);
+        num, 10, true, SignNeg, DigExact(dig), ExpDec, upper);
     r
 }
 
@@ -457,7 +458,7 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper);
+        num, 10, true, SignNeg, DigMax(dig), ExpDec, upper);
     r
 }
 
diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs
index 8b17feeb70c..0ce56371c77 100644
--- a/src/libstd/num/f64.rs
+++ b/src/libstd/num/f64.rs
@@ -29,6 +29,7 @@ use core::num;
 pub use core::f64::{RADIX, MANTISSA_DIGITS, DIGITS, EPSILON, MIN_VALUE};
 pub use core::f64::{MIN_POS_VALUE, MAX_VALUE, MIN_EXP, MAX_EXP, MIN_10_EXP};
 pub use core::f64::{MAX_10_EXP, NAN, INFINITY, NEG_INFINITY};
+pub use core::f64::{MIN, MIN_POSITIVE, MAX};
 pub use core::f64::consts;
 
 #[allow(dead_code)]
@@ -378,7 +379,7 @@ impl Float for f64 {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_string(num: f64) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigAll, ExpNone, false);
+        num, 10, true, SignNeg, DigAll, ExpNone, false);
     r
 }
 
@@ -391,7 +392,7 @@ pub fn to_string(num: f64) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_hex(num: f64) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 16u, true, SignNeg, DigAll, ExpNone, false);
+        num, 16, true, SignNeg, DigAll, ExpNone, false);
     r
 }
 
@@ -404,7 +405,7 @@ pub fn to_str_hex(num: f64) -> String {
 /// * radix - The base to use
 #[inline]
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
-pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) {
+pub fn to_str_radix_special(num: f64, rdx: u32) -> (String, bool) {
     strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false)
 }
 
@@ -419,7 +420,7 @@ pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_exact(num: f64, dig: uint) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigExact(dig), ExpNone, false);
+        num, 10, true, SignNeg, DigExact(dig), ExpNone, false);
     r
 }
 
@@ -434,7 +435,7 @@ pub fn to_str_exact(num: f64, dig: uint) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_digits(num: f64, dig: uint) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigMax(dig), ExpNone, false);
+        num, 10, true, SignNeg, DigMax(dig), ExpNone, false);
     r
 }
 
@@ -450,7 +451,7 @@ pub fn to_str_digits(num: f64, dig: uint) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper);
+        num, 10, true, SignNeg, DigExact(dig), ExpDec, upper);
     r
 }
 
@@ -466,7 +467,7 @@ pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String {
 #[unstable(feature = "std_misc", reason = "may be removed or relocated")]
 pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> String {
     let (r, _) = strconv::float_to_str_common(
-        num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper);
+        num, 10, true, SignNeg, DigMax(dig), ExpDec, upper);
     r
 }
 
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs
index 4ae7d3437fd..cf5e1eb0eb7 100644
--- a/src/libstd/num/strconv.rs
+++ b/src/libstd/num/strconv.rs
@@ -182,7 +182,7 @@ fn int_to_str_bytes_common<T, F>(num: T, radix: uint, sign: SignFormat, mut f: F
 /// - Panics if `radix` > 25 and `exp_format` is `ExpBin` due to conflict
 ///   between digit and exponent sign `'p'`.
 pub fn float_to_str_bytes_common<T: Float>(
-        num: T, radix: uint, negative_zero: bool,
+        num: T, radix: u32, negative_zero: bool,
         sign: SignFormat, digits: SignificantDigits, exp_format: ExponentFormat, exp_upper: bool
         ) -> (Vec<u8>, bool) {
     assert!(2 <= radix && radix <= 36);
@@ -253,7 +253,7 @@ pub fn float_to_str_bytes_common<T: Float>(
         deccum = deccum / radix_gen;
         deccum = deccum.trunc();
 
-        buf.push(char::from_digit(current_digit.to_int().unwrap() as uint, radix)
+        buf.push(char::from_digit(current_digit.to_int().unwrap() as u32, radix)
              .unwrap() as u8);
 
         // No more digits to calculate for the non-fractional part -> break
@@ -310,7 +310,7 @@ pub fn float_to_str_bytes_common<T: Float>(
             let current_digit = deccum.trunc().abs();
 
             buf.push(char::from_digit(
-                current_digit.to_int().unwrap() as uint, radix).unwrap() as u8);
+                current_digit.to_int().unwrap() as u32, radix).unwrap() as u8);
 
             // Decrease the deccumulator one fractional digit at a time
             deccum = deccum.fract();
@@ -324,7 +324,7 @@ pub fn float_to_str_bytes_common<T: Float>(
             let ascii2value = |chr: u8| {
                 (chr as char).to_digit(radix).unwrap()
             };
-            let value2ascii = |val: uint| {
+            let value2ascii = |val: u32| {
                 char::from_digit(val, radix).unwrap() as u8
             };
 
@@ -412,7 +412,7 @@ pub fn float_to_str_bytes_common<T: Float>(
 /// `to_str_bytes_common()`, for details see there.
 #[inline]
 pub fn float_to_str_common<T: Float>(
-        num: T, radix: uint, negative_zero: bool,
+        num: T, radix: u32, negative_zero: bool,
         sign: SignFormat, digits: SignificantDigits, exp_format: ExponentFormat, exp_capital: bool
         ) -> (String, bool) {
     let (bytes, special) = float_to_str_bytes_common(num, radix,
@@ -422,8 +422,8 @@ pub fn float_to_str_common<T: Float>(
 
 // Some constants for from_str_bytes_common's input validation,
 // they define minimum radix values for which the character is a valid digit.
-static DIGIT_P_RADIX: uint = ('p' as uint) - ('a' as uint) + 11u;
-static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
+static DIGIT_P_RADIX: u32 = ('p' as u32) - ('a' as u32) + 11;
+static DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11;
 
 #[cfg(test)]
 mod tests {
diff --git a/src/libstd/old_io/net/udp.rs b/src/libstd/old_io/net/udp.rs
index 5f1089bc63b..8dc19047de0 100644
--- a/src/libstd/old_io/net/udp.rs
+++ b/src/libstd/old_io/net/udp.rs
@@ -32,7 +32,6 @@ use sys_common;
 ///
 /// ```rust,no_run
 /// # #![allow(unused_must_use)]
-/// #![feature(slicing_syntax)]
 ///
 /// use std::old_io::net::udp::UdpSocket;
 /// use std::old_io::net::ip::{Ipv4Addr, SocketAddr};
diff --git a/src/libstd/old_io/stdio.rs b/src/libstd/old_io/stdio.rs
index 8e55251d285..70cce1f7e76 100644
--- a/src/libstd/old_io/stdio.rs
+++ b/src/libstd/old_io/stdio.rs
@@ -30,7 +30,7 @@ use self::StdSource::*;
 use boxed::Box;
 use cell::RefCell;
 use clone::Clone;
-use failure::LOCAL_STDERR;
+use panicking::LOCAL_STDERR;
 use fmt;
 use old_io::{Reader, Writer, IoResult, IoError, OtherIoError, Buffer,
          standard_error, EndOfFile, LineBufferedWriter, BufferedReader};
diff --git a/src/libstd/failure.rs b/src/libstd/panicking.rs
index c184d3f4661..e485c6a63c6 100644
--- a/src/libstd/failure.rs
+++ b/src/libstd/panicking.rs
@@ -33,7 +33,7 @@ impl Writer for Stdio {
     }
 }
 
-pub fn on_fail(obj: &(Any+Send), file: &'static str, line: uint) {
+pub fn on_panic(obj: &(Any+Send), file: &'static str, line: uint) {
     let msg = match obj.downcast_ref::<&'static str>() {
         Some(s) => *s,
         None => match obj.downcast_ref::<String>() {
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 271a4cdb629..1f6d39fb1b3 100755
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1033,6 +1033,7 @@ impl AsOsStr for PathBuf {
 /// let parent_dir = path.parent();
 /// ```
 ///
+#[derive(Hash)]
 pub struct Path {
     inner: OsStr
 }
diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs
index 659e787a9ff..464adadde62 100644
--- a/src/libstd/rt/unwind.rs
+++ b/src/libstd/rt/unwind.rs
@@ -62,7 +62,7 @@ use prelude::v1::*;
 use any::Any;
 use cell::Cell;
 use cmp;
-use failure;
+use panicking;
 use fmt;
 use intrinsics;
 use libc::c_void;
@@ -534,10 +534,10 @@ pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, uint)) ->
 /// }` from ~1900/3700 (-O/no opts) to 180/590.
 #[inline(never)] #[cold] // this is the slow path, please never inline this
 fn begin_unwind_inner(msg: Box<Any + Send>, file_line: &(&'static str, uint)) -> ! {
-    // Make sure the default failure handler is registered before we look at the
+    // Make sure the default panic handler is registered before we look at the
     // callbacks.
     static INIT: Once = ONCE_INIT;
-    INIT.call_once(|| unsafe { register(failure::on_fail); });
+    INIT.call_once(|| unsafe { register(panicking::on_panic); });
 
     // First, invoke call the user-defined callbacks triggered on thread panic.
     //
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs
index 2e60d684d68..d783acd57ac 100644
--- a/src/libstd/sync/mpsc/mod.rs
+++ b/src/libstd/sync/mpsc/mod.rs
@@ -1024,14 +1024,14 @@ impl fmt::Display for TryRecvError {
 mod test {
     use prelude::v1::*;
 
-    use os;
+    use std::env;
     use super::*;
     use thread::Thread;
 
     pub fn stress_factor() -> uint {
-        match os::getenv("RUST_TEST_STRESS") {
-            Some(val) => val.parse().unwrap(),
-            None => 1,
+        match env::var("RUST_TEST_STRESS") {
+            Ok(val) => val.parse().unwrap(),
+            Err(..) => 1,
         }
     }
 
@@ -1546,14 +1546,14 @@ mod test {
 mod sync_tests {
     use prelude::v1::*;
 
-    use os;
+    use std::env;
     use thread::Thread;
     use super::*;
 
     pub fn stress_factor() -> uint {
-        match os::getenv("RUST_TEST_STRESS") {
-            Some(val) => val.parse().unwrap(),
-            None => 1,
+        match env::var("RUST_TEST_STRESS") {
+            Ok(val) => val.parse().unwrap(),
+            Err(..) => 1,
         }
     }
 
diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs
index babae93b2d4..87b2fe8f100 100644
--- a/src/libstd/sync/mpsc/select.rs
+++ b/src/libstd/sync/mpsc/select.rs
@@ -111,11 +111,18 @@ pub trait Packet {
 }
 
 impl Select {
-    /// Creates a new selection structure. This set is initially empty and
-    /// `wait` will panic!() if called.
+    /// Creates a new selection structure. This set is initially empty.
     ///
-    /// Usage of this struct directly can sometimes be burdensome, and usage is
-    /// rather much easier through the `select!` macro.
+    /// Usage of this struct directly can sometimes be burdensome, and usage is much easier through
+    /// the `select!` macro.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::mpsc::Select;
+    ///
+    /// let select = Select::new();
+    /// ```
     pub fn new() -> Select {
         Select {
             head: ptr::null_mut(),