diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ascii.rs | 6 | ||||
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 9 | ||||
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/buffered.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/cursor.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/util.rs | 4 | ||||
| -rw-r--r-- | src/libstd/macros.rs | 3 | ||||
| -rw-r--r-- | src/libstd/net/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/num/f32.rs | 18 | ||||
| -rw-r--r-- | src/libstd/num/f64.rs | 11 | ||||
| -rw-r--r-- | src/libstd/primitive_docs.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/condvar.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/future.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/mutex.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/semaphore.rs | 3 | ||||
| -rw-r--r-- | src/libstd/thread/mod.rs | 6 | ||||
| -rw-r--r-- | src/libstd/thread/scoped_tls.rs | 9 |
20 files changed, 68 insertions, 43 deletions
diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index ac98282ebb8..cd9dadd1be9 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -125,7 +125,8 @@ pub trait AsciiExt { /// # Examples /// /// ``` - /// # #![feature(ascii)] + /// #![feature(ascii)] + /// /// use std::ascii::AsciiExt; /// /// let mut ascii = 'a'; @@ -144,7 +145,8 @@ pub trait AsciiExt { /// # Examples /// /// ``` - /// # #![feature(ascii)] + /// #![feature(ascii)] + /// /// use std::ascii::AsciiExt; /// /// let mut ascii = 'A'; diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 06a30670e8b..66f894fc31f 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -543,7 +543,8 @@ impl<K, V, S> HashMap<K, V, S> /// # Examples /// /// ``` - /// # #![feature(hashmap_hasher)] + /// #![feature(hashmap_hasher)] + /// /// use std::collections::HashMap; /// use std::collections::hash_map::RandomState; /// @@ -572,7 +573,8 @@ impl<K, V, S> HashMap<K, V, S> /// # Examples /// /// ``` - /// # #![feature(hashmap_hasher)] + /// #![feature(hashmap_hasher)] + /// /// use std::collections::HashMap; /// use std::collections::hash_map::RandomState; /// @@ -979,7 +981,8 @@ impl<K, V, S> HashMap<K, V, S> /// # Examples /// /// ``` - /// # #![feature(drain)] + /// #![feature(drain)] + /// /// use std::collections::HashMap; /// /// let mut a = HashMap::new(); diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index ba50b156ab2..fb594dadd73 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -154,7 +154,8 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` - /// # #![feature(hashmap_hasher)] + /// #![feature(hashmap_hasher)] + /// /// use std::collections::HashSet; /// use std::collections::hash_map::RandomState; /// @@ -179,7 +180,8 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` - /// # #![feature(hashmap_hasher)] + /// #![feature(hashmap_hasher)] + /// /// use std::collections::HashSet; /// use std::collections::hash_map::RandomState; /// diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 29d1fe19adf..eca6ffc8ce3 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -407,8 +407,6 @@ impl<W: Write> BufWriter<W> { /// Gets a mutable reference to the underlying writer. /// - /// # Warning - /// /// It is inadvisable to directly write to the underlying writer. /// /// # Examples @@ -835,8 +833,6 @@ impl<S: Read + Write> BufStream<S> { /// Gets a mutable reference to the underlying stream. /// - /// # Warning - /// /// It is inadvisable to read directly from or write directly to the /// underlying stream. pub fn get_mut(&mut self) -> &mut S { diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs index 4bb7d2ebd19..980ec51c926 100644 --- a/src/libstd/io/cursor.rs +++ b/src/libstd/io/cursor.rs @@ -15,10 +15,8 @@ use cmp; use io::{self, SeekFrom, Error, ErrorKind}; use slice; -/// A `Cursor` wraps another type and provides it with a [`Seek`][seek] -/// implementation. -/// -/// [seek]: trait.Seek.html +/// A `Cursor` wraps another type and provides it with a +/// [`Seek`](trait.Seek.html) implementation. /// /// Cursors are typically used with in-memory buffers to allow them to /// implement `Read` and/or `Write`, allowing these buffers to be used diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index ffdd75b0e6e..f811aa1be4e 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -707,7 +707,7 @@ pub trait Read { /// /// # fn foo() -> io::Result<()> { /// let mut f = try!(File::open("foo.txt")); - /// let mut buffer = [0; 10]; + /// let mut buffer = [0; 5]; /// /// // read at most five bytes /// let mut handle = f.take(5); diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index dc29811ed5b..6e651464c74 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -105,7 +105,7 @@ impl BufRead for Empty { /// This struct is generally created by calling [`repeat()`][repeat]. Please /// see the documentation of `repeat()` for more details. /// -/// [empty]: fn.repeat.html +/// [repeat]: fn.repeat.html #[stable(feature = "rust1", since = "1.0.0")] pub struct Repeat { byte: u8 } @@ -131,7 +131,7 @@ impl Read for Repeat { /// This struct is generally created by calling [`sink()`][sink]. Please /// see the documentation of `sink()` for more details. /// -/// [empty]: fn.sink.html +/// [sink]: fn.sink.html #[stable(feature = "rust1", since = "1.0.0")] pub struct Sink { _priv: () } diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 697b934c676..eb378bf4080 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -141,7 +141,8 @@ macro_rules! try { /// # Examples /// /// ``` -/// # #![feature(mpsc_select)] +/// #![feature(mpsc_select)] +/// /// use std::thread; /// use std::sync::mpsc; /// diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index 1cb8c187030..c7daf5cdee5 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -103,7 +103,8 @@ impl Iterator for LookupHost { /// # Examples /// /// ```no_run -/// # #![feature(lookup_host)] +/// #![feature(lookup_host)] +/// /// use std::net; /// /// # fn foo() -> std::io::Result<()> { diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 9d0b9c3bbb4..73d6639cf00 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -235,7 +235,8 @@ impl f32 { /// The floating point encoding is documented in the [Reference][floating-point]. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// use std::f32; /// /// let num = 2.0f32; @@ -598,7 +599,8 @@ impl f32 { /// Converts radians to degrees. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// use std::f32::{self, consts}; /// /// let angle = consts::PI; @@ -614,7 +616,8 @@ impl f32 { /// Converts degrees to radians. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// use std::f32::{self, consts}; /// /// let angle = 180.0f32; @@ -630,7 +633,8 @@ impl f32 { /// Constructs a floating point number of `x*2^exp`. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// use std::f32; /// // 3*2^2 - 12 == 0 /// let abs_difference = (f32::ldexp(3.0, 2) - 12.0).abs(); @@ -651,7 +655,8 @@ impl f32 { /// * `0.5 <= abs(x) < 1.0` /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// use std::f32; /// /// let x = 4.0f32; @@ -679,7 +684,8 @@ impl f32 { /// `other`. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// use std::f32; /// /// let x = 1.0f32; diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 4f2f59659ac..3911d276b0f 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -191,7 +191,8 @@ impl f64 { /// The floating point encoding is documented in the [Reference][floating-point]. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// let num = 2.0f64; /// /// // (8388608, -22, 1) @@ -568,7 +569,8 @@ impl f64 { /// Constructs a floating point number of `x*2^exp`. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// // 3*2^2 - 12 == 0 /// let abs_difference = (f64::ldexp(3.0, 2) - 12.0).abs(); /// @@ -588,7 +590,8 @@ impl f64 { /// * `0.5 <= abs(x) < 1.0` /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] + /// /// let x = 4.0_f64; /// /// // (1/2)*2^3 -> 1 * 8/2 -> 4.0 @@ -614,7 +617,7 @@ impl f64 { /// `other`. /// /// ``` - /// # #![feature(float_extras)] + /// #![feature(float_extras)] /// /// let x = 1.0f32; /// diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 066b2b576da..7f14ea93c52 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -111,7 +111,8 @@ mod prim_unit { } /// the raw pointer. It doesn't destroy `T` or deallocate any memory. /// /// ``` -/// # #![feature(box_raw)] +/// #![feature(box_raw)] +/// /// let my_speed: Box<i32> = Box::new(88); /// let my_speed: *mut i32 = Box::into_raw(my_speed); /// diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index f2c389f9426..79b3dfa67b1 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -69,7 +69,8 @@ pub struct Condvar { inner: Box<StaticCondvar> } /// # Examples /// /// ``` -/// # #![feature(static_condvar)] +/// #![feature(static_condvar)] +/// /// use std::sync::{StaticCondvar, CONDVAR_INIT}; /// /// static CVAR: StaticCondvar = CONDVAR_INIT; diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index 28dc124f033..b87a2756829 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -14,7 +14,8 @@ //! # Examples //! //! ``` -//! # #![feature(future)] +//! #![feature(future)] +//! //! use std::sync::Future; //! //! // a fake, for now diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index a67138742ae..ee1516342ad 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -27,7 +27,8 @@ //! # Examples //! //! ```rust -//! # #![feature(mpsc_select)] +//! #![feature(mpsc_select)] +//! //! use std::sync::mpsc::channel; //! //! let (tx1, rx1) = channel(); @@ -124,7 +125,8 @@ impl Select { /// # Examples /// /// ``` - /// # #![feature(mpsc_select)] + /// #![feature(mpsc_select)] + /// /// use std::sync::mpsc::Select; /// /// let select = Select::new(); diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 41cd11e4c69..4b62434d068 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -138,7 +138,8 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> { } /// # Examples /// /// ``` -/// # #![feature(static_mutex)] +/// #![feature(static_mutex)] +/// /// use std::sync::{StaticMutex, MUTEX_INIT}; /// /// static LOCK: StaticMutex = MUTEX_INIT; diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 4ca2e282f70..40d5af49156 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -81,7 +81,8 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {} /// # Examples /// /// ``` -/// # #![feature(static_rwlock)] +/// #![feature(static_rwlock)] +/// /// use std::sync::{StaticRwLock, RW_LOCK_INIT}; /// /// static LOCK: StaticRwLock = RW_LOCK_INIT; diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs index dc9e467a8b1..907df69bfb0 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -25,7 +25,8 @@ use sync::{Mutex, Condvar}; /// # Examples /// /// ``` -/// # #![feature(semaphore)] +/// #![feature(semaphore)] +/// /// use std::sync::Semaphore; /// /// // Create a semaphore that represents 5 resources diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 3388968c56c..2683f8e5022 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -367,7 +367,8 @@ pub fn spawn<F, T>(f: F) -> JoinHandle<T> where /// a join before any relevant stack frames are popped: /// /// ```rust -/// # #![feature(scoped)] +/// #![feature(scoped)] +/// /// use std::thread; /// /// let guard = thread::scoped(move || { @@ -447,7 +448,8 @@ pub fn panicking() -> bool { /// # Examples /// /// ``` -/// # #![feature(catch_panic)] +/// #![feature(catch_panic)] +/// /// use std::thread; /// /// let result = thread::catch_panic(|| { diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs index c2fad0aa89c..4fbfdec8e7e 100644 --- a/src/libstd/thread/scoped_tls.rs +++ b/src/libstd/thread/scoped_tls.rs @@ -24,7 +24,8 @@ //! # Examples //! //! ``` -//! # #![feature(scoped_tls)] +//! #![feature(scoped_tls)] +//! //! scoped_thread_local!(static FOO: u32); //! //! // Initially each scoped slot is empty. @@ -136,7 +137,8 @@ impl<T> ScopedKey<T> { /// # Examples /// /// ``` - /// # #![feature(scoped_tls)] + /// #![feature(scoped_tls)] + /// /// scoped_thread_local!(static FOO: u32); /// /// FOO.set(&100, || { @@ -189,7 +191,8 @@ impl<T> ScopedKey<T> { /// # Examples /// /// ```no_run - /// # #![feature(scoped_tls)] + /// #![feature(scoped_tls)] + /// /// scoped_thread_local!(static FOO: u32); /// /// FOO.with(|slot| { |
