about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-03-20 07:12:39 +0000
committerbors <bors@rust-lang.org>2015-03-20 07:12:39 +0000
commit0834bd1b3db4e9c1477871cc962459b11e298234 (patch)
tree4a63350e8437a7fb81d9351e29289214908c0b82 /src/libstd
parentfda8673531c2ecea13c86216f964feb6091b4ade (diff)
parent6107e4c0b88d9e22482ed88c52b98c2ec2034bb1 (diff)
downloadrust-0834bd1b3db4e9c1477871cc962459b11e298234.tar.gz
rust-0834bd1b3db4e9c1477871cc962459b11e298234.zip
Auto merge of #23548 - Manishearth:rollup, r=Manishearth
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/fs/mod.rs5
-rw-r--r--src/libstd/io/mod.rs3
-rw-r--r--src/libstd/num/f32.rs8
-rw-r--r--src/libstd/num/f64.rs8
-rw-r--r--src/libstd/num/mod.rs2
-rw-r--r--src/libstd/rt/mod.rs2
-rw-r--r--src/libstd/rt/util.rs23
7 files changed, 17 insertions, 34 deletions
diff --git a/src/libstd/fs/mod.rs b/src/libstd/fs/mod.rs
index 80336a0da87..c56852cb18a 100644
--- a/src/libstd/fs/mod.rs
+++ b/src/libstd/fs/mod.rs
@@ -73,6 +73,11 @@ pub struct Metadata(fs_imp::FileAttr);
 /// will yield instances of `io::Result<DirEntry>`. Through a `DirEntry`
 /// information like the entry's path and possibly other metadata can be
 /// learned.
+///
+/// # Failure
+///
+/// This `io::Result` will be an `Err` if there's some sort of intermittent
+/// IO error during iteration.
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct ReadDir(fs_imp::ReadDir);
 
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 8691c84a462..237435d6dfb 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -584,7 +584,8 @@ pub trait BufRead: Read {
         read_until(self, byte, buf)
     }
 
-    /// Read all bytes until a newline byte (the 0xA byte) is reached.
+    /// Read all bytes until a newline byte (the 0xA byte) is reached, and
+    /// append them to the provided buffer.
     ///
     /// This function will continue to read (and buffer) bytes from the
     /// underlying stream until the newline delimiter (the 0xA byte) or EOF is
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs
index 11e2b8dca1b..b5513dfd035 100644
--- a/src/libstd/num/f32.rs
+++ b/src/libstd/num/f32.rs
@@ -191,8 +191,8 @@ impl Float for f32 {
     /// Constructs a floating point number by multiplying `x` by 2 raised to the
     /// power of `exp`
     #[inline]
-    fn ldexp(x: f32, exp: int) -> f32 {
-        unsafe { cmath::ldexpf(x, exp as c_int) }
+    fn ldexp(self, exp: isize) -> f32 {
+        unsafe { cmath::ldexpf(self, exp as c_int) }
     }
 
     /// Breaks the number into a normalized fraction and a base-2 exponent,
@@ -2207,8 +2207,8 @@ mod tests {
         let f1: f32 = FromStrRadix::from_str_radix("1p-123", 16).unwrap();
         let f2: f32 = FromStrRadix::from_str_radix("1p-111", 16).unwrap();
         let f3: f32 = FromStrRadix::from_str_radix("1.Cp-12", 16).unwrap();
-        assert_eq!(Float::ldexp(1f32, -123), f1);
-        assert_eq!(Float::ldexp(1f32, -111), f2);
+        assert_eq!(1f32.ldexp(-123), f1);
+        assert_eq!(1f32.ldexp(-111), f2);
         assert_eq!(Float::ldexp(1.75f32, -12), f3);
 
         assert_eq!(Float::ldexp(0f32, -123), 0f32);
diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs
index 650f642220f..61bddc3d18f 100644
--- a/src/libstd/num/f64.rs
+++ b/src/libstd/num/f64.rs
@@ -200,8 +200,8 @@ impl Float for f64 {
     fn to_radians(self) -> f64 { num::Float::to_radians(self) }
 
     #[inline]
-    fn ldexp(x: f64, exp: int) -> f64 {
-        unsafe { cmath::ldexp(x, exp as c_int) }
+    fn ldexp(self, exp: isize) -> f64 {
+        unsafe { cmath::ldexp(self, exp as c_int) }
     }
 
     /// Breaks the number into a normalized fraction and a base-2 exponent,
@@ -2214,8 +2214,8 @@ mod tests {
         let f1: f64 = FromStrRadix::from_str_radix("1p-123", 16).unwrap();
         let f2: f64 = FromStrRadix::from_str_radix("1p-111", 16).unwrap();
         let f3: f64 = FromStrRadix::from_str_radix("1.Cp-12", 16).unwrap();
-        assert_eq!(Float::ldexp(1f64, -123), f1);
-        assert_eq!(Float::ldexp(1f64, -111), f2);
+        assert_eq!(1f64.ldexp(-123), f1);
+        assert_eq!(1f64.ldexp(-111), f2);
         assert_eq!(Float::ldexp(1.75f64, -12), f3);
 
         assert_eq!(Float::ldexp(0f64, -123), 0f64);
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs
index 37f1f691776..082dad613b5 100644
--- a/src/libstd/num/mod.rs
+++ b/src/libstd/num/mod.rs
@@ -699,7 +699,7 @@ pub trait Float
     /// ```
     #[unstable(feature = "std_misc",
                reason = "pending integer conventions")]
-    fn ldexp(x: Self, exp: isize) -> Self;
+    fn ldexp(self, exp: isize) -> Self;
     /// Breaks the number into a normalized fraction and a base-2 exponent,
     /// satisfying:
     ///
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index 90cc189b9a0..5e8abfd0a3f 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -30,7 +30,7 @@ use thunk::Thunk;
 use usize;
 
 // Reexport some of our utilities which are expected by other crates.
-pub use self::util::{default_sched_threads, min_stack, running_on_valgrind};
+pub use self::util::{min_stack, running_on_valgrind};
 pub use self::unwind::{begin_unwind, begin_unwind_fmt};
 
 // Reexport some functionality from liballoc.
diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs
index e72fd7b3320..f1c43a07e6e 100644
--- a/src/libstd/rt/util.rs
+++ b/src/libstd/rt/util.rs
@@ -58,29 +58,6 @@ pub fn min_stack() -> uint {
     return amt;
 }
 
-/// Get's the number of scheduler threads requested by the environment
-/// either `RUST_THREADS` or `num_cpus`.
-#[allow(deprecated)]
-pub fn default_sched_threads() -> uint {
-    use os;
-    match env::var("RUST_THREADS") {
-        Ok(nstr) => {
-            let opt_n: Option<uint> = nstr.parse().ok();
-            match opt_n {
-                Some(n) if n > 0 => n,
-                _ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr)
-            }
-        }
-        Err(..) => {
-            if limit_thread_creation_due_to_osx_and_valgrind() {
-                1
-            } else {
-                os::num_cpus()
-            }
-        }
-    }
-}
-
 // Indicates whether we should perform expensive sanity checks, including rtassert!
 //
 // FIXME: Once the runtime matures remove the `true` below to turn off rtassert,