diff options
| author | Brian Anderson <banderson@mozilla.com> | 2015-03-13 15:28:35 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2015-03-23 14:40:26 -0700 |
| commit | e9019101a82dd7f61dcdcd52bcc0123d5ed25d22 (patch) | |
| tree | 6553b47da56745ce8cab9e17265bba143608aa97 /src/libstd | |
| parent | df290f127e923e0aacfe8223dd77f0fa222f0bc8 (diff) | |
| download | rust-e9019101a82dd7f61dcdcd52bcc0123d5ed25d22.tar.gz rust-e9019101a82dd7f61dcdcd52bcc0123d5ed25d22.zip | |
Add #![feature] attributes to doctests
Diffstat (limited to 'src/libstd')
42 files changed, 283 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 9139e182ce4..a632306454e 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -538,6 +538,7 @@ impl<K, V, S> HashMap<K, V, S> /// # Examples /// /// ``` + /// # #![feature(std_misc)] /// use std::collections::HashMap; /// use std::collections::hash_map::RandomState; /// @@ -566,6 +567,7 @@ impl<K, V, S> HashMap<K, V, S> /// # Examples /// /// ``` + /// # #![feature(std_misc)] /// use std::collections::HashMap; /// use std::collections::hash_map::RandomState; /// @@ -981,6 +983,7 @@ impl<K, V, S> HashMap<K, V, S> /// # Examples /// /// ``` + /// # #![feature(std_misc)] /// 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 de3f080de82..3bc511f8a22 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -145,6 +145,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(std_misc)] /// use std::collections::HashSet; /// use std::collections::hash_map::RandomState; /// @@ -169,6 +170,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(std_misc)] /// use std::collections::HashSet; /// use std::collections::hash_map::RandomState; /// @@ -295,6 +297,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect(); @@ -325,6 +328,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect(); @@ -351,6 +355,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect(); @@ -376,6 +381,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect(); @@ -458,6 +464,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// /// let set: HashSet<_> = [1, 2, 3].iter().cloned().collect(); @@ -477,6 +484,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); @@ -498,6 +506,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// /// let sup: HashSet<_> = [1, 2, 3].iter().cloned().collect(); @@ -519,6 +528,7 @@ impl<T, S> HashSet<T, S> /// # Examples /// /// ``` + /// # #![feature(core)] /// use std::collections::HashSet; /// /// let sub: HashSet<_> = [1, 2].iter().cloned().collect(); diff --git a/src/libstd/collections/mod.rs b/src/libstd/collections/mod.rs index caada8ae50f..8d24f6b1916 100644 --- a/src/libstd/collections/mod.rs +++ b/src/libstd/collections/mod.rs @@ -300,6 +300,7 @@ //! #### Counting the number of times each character in a string occurs //! //! ``` +//! # #![feature(collections)] //! use std::collections::btree_map::{BTreeMap, Entry}; //! //! let mut count = BTreeMap::new(); @@ -327,6 +328,7 @@ //! #### Tracking the inebriation of customers at a bar //! //! ``` +//! # #![feature(collections)] //! use std::collections::btree_map::{BTreeMap, Entry}; //! //! // A client of the bar. They have an id and a blood alcohol level. diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index fc4f03ff3a5..96088003b99 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -44,6 +44,7 @@ use vec::Vec; /// # Examples /// /// ```no_run +/// # #![feature(libc)] /// # extern crate libc; /// # fn main() { /// use std::ffi::CString; @@ -82,6 +83,7 @@ pub struct CString { /// Inspecting a foreign C string /// /// ```no_run +/// # #![feature(libc)] /// extern crate libc; /// use std::ffi::CStr; /// @@ -98,6 +100,7 @@ pub struct CString { /// Passing a Rust-originating C string /// /// ```no_run +/// # #![feature(libc)] /// extern crate libc; /// use std::ffi::{CString, CStr}; /// @@ -144,6 +147,7 @@ impl CString { /// # Examples /// /// ```no_run + /// # #![feature(libc)] /// extern crate libc; /// use std::ffi::CString; /// @@ -179,6 +183,7 @@ impl CString { /// # Examples /// /// ```no_run + /// # #![feature(libc)] /// extern crate libc; /// use std::ffi::CString; /// @@ -329,6 +334,7 @@ impl CStr { /// # Examples /// /// ```no_run + /// # #![feature(libc)] /// # extern crate libc; /// # fn main() { /// use std::ffi::CStr; diff --git a/src/libstd/fs/mod.rs b/src/libstd/fs/mod.rs index 7df6d6887a2..ba98e1ddd55 100644 --- a/src/libstd/fs/mod.rs +++ b/src/libstd/fs/mod.rs @@ -633,6 +633,7 @@ pub fn remove_dir_all<P: AsPath>(path: P) -> io::Result<()> { /// # Examples /// /// ``` +/// # #![feature(path_ext)] /// use std::io; /// use std::fs::{self, PathExt, DirEntry}; /// use std::path::Path; @@ -771,6 +772,7 @@ pub fn set_file_times<P: AsPath>(path: P, accessed: u64, /// # Examples /// /// ``` +/// # #![feature(fs)] /// # fn foo() -> std::io::Result<()> { /// use std::fs; /// diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 1aa2189d315..dc390b534b7 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -105,6 +105,7 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/", html_playground_url = "http://play.rust-lang.org/")] +#![doc(test(no_crate_inject))] #![feature(alloc)] #![feature(box_syntax)] diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index f4a7e8b1b98..061c00329d2 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -112,6 +112,7 @@ macro_rules! try { /// # Examples /// /// ``` +/// # #![feature(std_misc)] /// use std::thread; /// use std::sync::mpsc; /// diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index 87241117043..e8187dc2c40 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -263,6 +263,7 @@ impl hash::Hash for SocketAddrV6 { /// Some examples: /// /// ```no_run +/// # #![feature(net)] /// use std::net::{SocketAddrV4, TcpStream, UdpSocket, TcpListener, Ipv4Addr}; /// /// fn main() { diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index 543fdd16f41..48b3247f212 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -91,6 +91,7 @@ impl Iterator for LookupHost { /// # Examples /// /// ```no_run +/// # #![feature(net)] /// use std::net; /// /// # fn foo() -> std::io::Result<()> { diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index f263d7d72d3..869faa795f9 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -27,6 +27,7 @@ use sys_common::AsInner; /// # Examples /// /// ```no_run +/// # #![feature(net)] /// use std::io::prelude::*; /// use std::net::TcpStream; /// @@ -46,6 +47,7 @@ pub struct TcpStream(net_imp::TcpStream); /// # Examples /// /// ```no_run +/// # #![feature(net)] /// use std::net::{TcpListener, TcpStream}; /// use std::thread; /// diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs index 1ace1957526..e593bbe8e48 100644 --- a/src/libstd/net/udp.rs +++ b/src/libstd/net/udp.rs @@ -27,6 +27,7 @@ use sys_common::AsInner; /// # Examples /// /// ```no_run +/// # #![feature(net)] /// use std::net::UdpSocket; /// /// # fn foo() -> std::io::Result<()> { diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index b5513dfd035..a4f06f14d49 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -365,6 +365,7 @@ impl f32 { /// Returns the `NaN` value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let nan: f32 = Float::nan(); @@ -379,6 +380,7 @@ impl f32 { /// Returns the infinite value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -396,6 +398,7 @@ impl f32 { /// Returns the negative infinite value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -413,6 +416,7 @@ impl f32 { /// Returns `0.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let inf: f32 = Float::infinity(); @@ -431,6 +435,7 @@ impl f32 { /// Returns `-0.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let inf: f32 = Float::infinity(); @@ -449,6 +454,7 @@ impl f32 { /// Returns `1.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let one: f32 = Float::one(); @@ -525,6 +531,7 @@ impl f32 { /// Returns the smallest finite value that this type can represent. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -548,6 +555,7 @@ impl f32 { /// Returns the largest finite value that this type can represent. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -563,6 +571,7 @@ impl f32 { /// Returns `true` if this value is `NaN` and false otherwise. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -580,6 +589,7 @@ impl f32 { /// false otherwise. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -601,6 +611,7 @@ impl f32 { /// Returns `true` if this number is neither infinite nor `NaN`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -623,6 +634,7 @@ impl f32 { /// [subnormal][subnormal], or `NaN`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -650,6 +662,7 @@ impl f32 { /// predicate instead. /// /// ``` + /// # #![feature(core)] /// use std::num::{Float, FpCategory}; /// use std::f32; /// @@ -668,6 +681,7 @@ impl f32 { /// The floating point encoding is documented in the [Reference][floating-point]. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let num = 2.0f32; @@ -770,6 +784,7 @@ impl f32 { /// number is `Float::nan()`. /// /// ``` + /// # #![feature(core, std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -795,6 +810,7 @@ impl f32 { /// - `Float::nan()` if the number is `Float::nan()` /// /// ``` + /// # #![feature(core, std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -856,6 +872,7 @@ impl f32 { /// a separate multiplication operation followed by an add. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let m = 10.0; @@ -875,6 +892,7 @@ impl f32 { /// Take the reciprocal (inverse) of a number, `1/x`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 2.0; @@ -922,6 +940,7 @@ impl f32 { /// Returns NaN if `self` is a negative number. /// /// ``` + /// # #![feature(core, std_misc)] /// use std::num::Float; /// /// let positive = 4.0; @@ -940,6 +959,7 @@ impl f32 { /// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let f = 4.0; @@ -1061,6 +1081,7 @@ impl f32 { /// Convert radians to degrees. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64::consts; /// @@ -1077,6 +1098,7 @@ impl f32 { /// Convert degrees to radians. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64::consts; /// @@ -1093,6 +1115,7 @@ impl f32 { /// Constructs a floating point number of `x*2^exp`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// // 3*2^2 - 12 == 0 @@ -1114,6 +1137,7 @@ impl f32 { /// * `0.5 <= abs(x) < 1.0` /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 4.0; @@ -1141,6 +1165,7 @@ impl f32 { /// `other`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 1.0f32; @@ -1194,6 +1219,7 @@ impl f32 { /// * Else: `self - other` /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 3.0; @@ -1214,6 +1240,7 @@ impl f32 { /// Take the cubic root of a number. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 8.0; @@ -1233,6 +1260,7 @@ impl f32 { /// legs of length `x` and `y`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 2.0; @@ -1253,6 +1281,7 @@ impl f32 { /// Computes the sine of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1271,6 +1300,7 @@ impl f32 { /// Computes the cosine of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1289,6 +1319,7 @@ impl f32 { /// Computes the tangent of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1308,6 +1339,7 @@ impl f32 { /// [-1, 1]. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1329,6 +1361,7 @@ impl f32 { /// [-1, 1]. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1372,6 +1405,7 @@ impl f32 { /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1401,6 +1435,7 @@ impl f32 { /// `(sin(x), cos(x))`. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1423,6 +1458,7 @@ impl f32 { /// number is close to zero. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 7.0; @@ -1442,6 +1478,7 @@ impl f32 { /// the operations were performed separately. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64; /// @@ -1461,6 +1498,7 @@ impl f32 { /// Hyperbolic sine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1483,6 +1521,7 @@ impl f32 { /// Hyperbolic cosine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1505,6 +1544,7 @@ impl f32 { /// Hyperbolic tangent function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1527,6 +1567,7 @@ impl f32 { /// Inverse hyperbolic sine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// /// let x = 1.0; @@ -1548,6 +1589,7 @@ impl f32 { /// Inverse hyperbolic cosine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// /// let x = 1.0; @@ -1569,6 +1611,7 @@ impl f32 { /// Inverse hyperbolic tangent function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 61bddc3d18f..9306804d1f7 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -374,6 +374,7 @@ impl f64 { /// Returns the `NaN` value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let nan: f32 = Float::nan(); @@ -388,6 +389,7 @@ impl f64 { /// Returns the infinite value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -405,6 +407,7 @@ impl f64 { /// Returns the negative infinite value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -422,6 +425,7 @@ impl f64 { /// Returns `0.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let inf: f32 = Float::infinity(); @@ -440,6 +444,7 @@ impl f64 { /// Returns `-0.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let inf: f32 = Float::infinity(); @@ -458,6 +463,7 @@ impl f64 { /// Returns `1.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let one: f32 = Float::one(); @@ -534,6 +540,7 @@ impl f64 { /// Returns the smallest finite value that this type can represent. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -557,6 +564,7 @@ impl f64 { /// Returns the largest finite value that this type can represent. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -572,6 +580,7 @@ impl f64 { /// Returns `true` if this value is `NaN` and false otherwise. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -589,6 +598,7 @@ impl f64 { /// false otherwise. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -610,6 +620,7 @@ impl f64 { /// Returns `true` if this number is neither infinite nor `NaN`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -632,6 +643,7 @@ impl f64 { /// [subnormal][subnormal], or `NaN`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -659,6 +671,7 @@ impl f64 { /// predicate instead. /// /// ``` + /// # #![feature(core)] /// use std::num::{Float, FpCategory}; /// use std::f32; /// @@ -677,6 +690,7 @@ impl f64 { /// The floating point encoding is documented in the [Reference][floating-point]. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let num = 2.0f32; @@ -779,6 +793,7 @@ impl f64 { /// number is `Float::nan()`. /// /// ``` + /// # #![feature(core, std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -804,6 +819,7 @@ impl f64 { /// - `Float::nan()` if the number is `Float::nan()` /// /// ``` + /// # #![feature(core, std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -865,6 +881,7 @@ impl f64 { /// a separate multiplication operation followed by an add. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let m = 10.0; @@ -884,6 +901,7 @@ impl f64 { /// Take the reciprocal (inverse) of a number, `1/x`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 2.0; @@ -931,6 +949,7 @@ impl f64 { /// Returns NaN if `self` is a negative number. /// /// ``` + /// # #![feature(core, std_misc)] /// use std::num::Float; /// /// let positive = 4.0; @@ -948,6 +967,7 @@ impl f64 { /// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let f = 4.0; @@ -1069,6 +1089,7 @@ impl f64 { /// Convert radians to degrees. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64::consts; /// @@ -1085,6 +1106,7 @@ impl f64 { /// Convert degrees to radians. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64::consts; /// @@ -1101,6 +1123,7 @@ impl f64 { /// Constructs a floating point number of `x*2^exp`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// // 3*2^2 - 12 == 0 @@ -1122,6 +1145,7 @@ impl f64 { /// * `0.5 <= abs(x) < 1.0` /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 4.0; @@ -1149,6 +1173,7 @@ impl f64 { /// `other`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 1.0f32; @@ -1202,6 +1227,7 @@ impl f64 { /// * Else: `self - other` /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 3.0; @@ -1222,6 +1248,7 @@ impl f64 { /// Take the cubic root of a number. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 8.0; @@ -1241,6 +1268,7 @@ impl f64 { /// legs of length `x` and `y`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 2.0; @@ -1261,6 +1289,7 @@ impl f64 { /// Computes the sine of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1279,6 +1308,7 @@ impl f64 { /// Computes the cosine of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1297,6 +1327,7 @@ impl f64 { /// Computes the tangent of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1316,6 +1347,7 @@ impl f64 { /// [-1, 1]. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1337,6 +1369,7 @@ impl f64 { /// [-1, 1]. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1380,6 +1413,7 @@ impl f64 { /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1409,6 +1443,7 @@ impl f64 { /// `(sin(x), cos(x))`. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1431,6 +1466,7 @@ impl f64 { /// number is close to zero. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 7.0; @@ -1450,6 +1486,7 @@ impl f64 { /// the operations were performed separately. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64; /// @@ -1469,6 +1506,7 @@ impl f64 { /// Hyperbolic sine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1491,6 +1529,7 @@ impl f64 { /// Hyperbolic cosine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1513,6 +1552,7 @@ impl f64 { /// Hyperbolic tangent function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1577,6 +1617,7 @@ impl f64 { /// Inverse hyperbolic tangent function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 562094a87f4..b9e9433e3ee 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -55,6 +55,7 @@ pub trait Float /// Returns the `NaN` value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let nan: f32 = Float::nan(); @@ -67,6 +68,7 @@ pub trait Float /// Returns the infinite value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -82,6 +84,7 @@ pub trait Float /// Returns the negative infinite value. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -97,6 +100,7 @@ pub trait Float /// Returns `0.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let inf: f32 = Float::infinity(); @@ -113,6 +117,7 @@ pub trait Float /// Returns `-0.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let inf: f32 = Float::infinity(); @@ -129,6 +134,7 @@ pub trait Float /// Returns `1.0`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let one: f32 = Float::one(); @@ -182,6 +188,7 @@ pub trait Float /// Returns the smallest finite value that this type can represent. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -199,6 +206,7 @@ pub trait Float /// Returns the largest finite value that this type can represent. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -211,6 +219,7 @@ pub trait Float /// Returns `true` if this value is `NaN` and false otherwise. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -226,6 +235,7 @@ pub trait Float /// false otherwise. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -245,6 +255,7 @@ pub trait Float /// Returns `true` if this number is neither infinite nor `NaN`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -265,6 +276,7 @@ pub trait Float /// [subnormal][subnormal], or `NaN`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f32; /// @@ -291,6 +303,7 @@ pub trait Float /// predicate instead. /// /// ``` + /// # #![feature(core)] /// use std::num::{Float, FpCategory}; /// use std::f32; /// @@ -308,6 +321,7 @@ pub trait Float /// The floating point encoding is documented in the [Reference][floating-point]. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let num = 2.0f32; @@ -399,6 +413,7 @@ pub trait Float /// number is `Float::nan()`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -422,6 +437,7 @@ pub trait Float /// - `Float::nan()` if the number is `Float::nan()` /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// use std::f64; /// @@ -478,6 +494,7 @@ pub trait Float /// a separate multiplication operation followed by an add. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let m = 10.0; @@ -495,6 +512,7 @@ pub trait Float /// Take the reciprocal (inverse) of a number, `1/x`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 2.0; @@ -537,6 +555,7 @@ pub trait Float /// Returns NaN if `self` is a negative number. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let positive = 4.0; @@ -553,6 +572,7 @@ pub trait Float /// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let f = 4.0; @@ -662,6 +682,7 @@ pub trait Float /// Convert radians to degrees. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64::consts; /// @@ -676,6 +697,7 @@ pub trait Float /// Convert degrees to radians. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64::consts; /// @@ -690,6 +712,7 @@ pub trait Float /// Constructs a floating point number of `x*2^exp`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// // 3*2^2 - 12 == 0 @@ -707,6 +730,7 @@ pub trait Float /// * `0.5 <= abs(x) < 1.0` /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 4.0; @@ -726,6 +750,7 @@ pub trait Float /// `other`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 1.0f32; @@ -769,6 +794,7 @@ pub trait Float /// * Else: `self - other` /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 3.0; @@ -785,6 +811,7 @@ pub trait Float /// Take the cubic root of a number. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 8.0; @@ -800,6 +827,7 @@ pub trait Float /// legs of length `x` and `y`. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 2.0; @@ -817,6 +845,7 @@ pub trait Float /// Computes the sine of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -831,6 +860,7 @@ pub trait Float /// Computes the cosine of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -845,6 +875,7 @@ pub trait Float /// Computes the tangent of a number (in radians). /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -860,6 +891,7 @@ pub trait Float /// [-1, 1]. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -877,6 +909,7 @@ pub trait Float /// [-1, 1]. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -912,6 +945,7 @@ pub trait Float /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -937,6 +971,7 @@ pub trait Float /// `(sin(x), cos(x))`. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -956,6 +991,7 @@ pub trait Float /// number is close to zero. /// /// ``` + /// # #![feature(std_misc)] /// use std::num::Float; /// /// let x = 7.0; @@ -971,6 +1007,7 @@ pub trait Float /// the operations were performed separately. /// /// ``` + /// # #![feature(std_misc, core)] /// use std::num::Float; /// use std::f64; /// @@ -987,6 +1024,7 @@ pub trait Float /// Hyperbolic sine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1005,6 +1043,7 @@ pub trait Float /// Hyperbolic cosine function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1023,6 +1062,7 @@ pub trait Float /// Hyperbolic tangent function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// @@ -1069,6 +1109,7 @@ pub trait Float /// Inverse hyperbolic tangent function. /// /// ``` + /// # #![feature(core)] /// use std::num::Float; /// use std::f64; /// diff --git a/src/libstd/old_io/buffered.rs b/src/libstd/old_io/buffered.rs index 3e5f732e345..cb67d709a14 100644 --- a/src/libstd/old_io/buffered.rs +++ b/src/libstd/old_io/buffered.rs @@ -33,6 +33,7 @@ use vec::Vec; /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// use std::old_io::*; /// use std::old_path::Path; /// @@ -137,6 +138,7 @@ impl<R: Reader> Reader for BufferedReader<R> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// use std::old_io::*; /// use std::old_path::Path; /// @@ -324,6 +326,7 @@ impl<W: Reader> Reader for InternalBufferedWriter<W> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// use std::old_path::Path; diff --git a/src/libstd/old_io/comm_adapters.rs b/src/libstd/old_io/comm_adapters.rs index 7e62a21f105..cd8252540da 100644 --- a/src/libstd/old_io/comm_adapters.rs +++ b/src/libstd/old_io/comm_adapters.rs @@ -23,6 +23,7 @@ use vec::Vec; /// # Examples /// /// ``` +/// # #![feature(old_io)] /// use std::sync::mpsc::channel; /// use std::old_io::*; /// @@ -114,6 +115,7 @@ impl Reader for ChanReader { /// # Examples /// /// ``` +/// # #![feature(old_io, io)] /// # #![allow(unused_must_use)] /// use std::sync::mpsc::channel; /// use std::old_io::*; diff --git a/src/libstd/old_io/fs.rs b/src/libstd/old_io/fs.rs index 87e5b91fc28..40a7cce81dd 100644 --- a/src/libstd/old_io/fs.rs +++ b/src/libstd/old_io/fs.rs @@ -30,6 +30,7 @@ //! # Examples //! //! ```rust +//! # #![feature(old_io, io, old_path)] //! # #![allow(unused_must_use)] //! use std::old_io::fs::PathExtensions; //! use std::old_io::*; @@ -105,6 +106,7 @@ impl File { /// # Examples /// /// ```rust,should_fail + /// # #![feature(old_io, old_path)] /// use std::old_io::*; /// use std::old_path::Path; /// @@ -177,6 +179,7 @@ impl File { /// # Examples /// /// ``` + /// # #![feature(old_io, old_path)] /// use std::old_io::*; /// use std::old_path::Path; /// @@ -197,6 +200,7 @@ impl File { /// # Examples /// /// ``` + /// # #![feature(old_io, old_path, io)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// use std::old_path::Path; @@ -289,6 +293,7 @@ impl File { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// use std::old_path::Path; @@ -321,6 +326,7 @@ pub fn unlink(path: &Path) -> IoResult<()> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// use std::old_io::*; /// use std::old_path::Path; /// @@ -364,6 +370,7 @@ pub fn lstat(path: &Path) -> IoResult<FileStat> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// use std::old_path::Path; @@ -393,6 +400,7 @@ pub fn rename(from: &Path, to: &Path) -> IoResult<()> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// use std::old_path::Path; @@ -444,6 +452,7 @@ pub fn copy(from: &Path, to: &Path) -> IoResult<()> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// # #![allow(unused_must_use)] /// use std::old_io; /// use std::old_io::*; @@ -516,6 +525,7 @@ pub fn readlink(path: &Path) -> IoResult<Path> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path, old_fs)] /// # #![allow(unused_must_use)] /// use std::old_io; /// use std::old_io::*; @@ -541,6 +551,7 @@ pub fn mkdir(path: &Path, mode: FilePermission) -> IoResult<()> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// use std::old_path::Path; @@ -566,6 +577,7 @@ pub fn rmdir(path: &Path) -> IoResult<()> { /// # Examples /// /// ``` +/// # #![feature(old_io, old_path)] /// use std::old_io::fs::PathExtensions; /// use std::old_io; /// use std::old_io::*; diff --git a/src/libstd/old_io/mem.rs b/src/libstd/old_io/mem.rs index 1acc6abc850..d877a60b079 100644 --- a/src/libstd/old_io/mem.rs +++ b/src/libstd/old_io/mem.rs @@ -54,6 +54,7 @@ impl Writer for Vec<u8> { /// # Examples /// /// ``` +/// # #![feature(old_io, io)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// @@ -114,6 +115,7 @@ impl Writer for MemWriter { /// # Examples /// /// ``` +/// # #![feature(old_io)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// @@ -244,6 +246,7 @@ impl<'a> Buffer for &'a [u8] { /// # Examples /// /// ``` +/// # #![feature(old_io, io)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// @@ -316,6 +319,7 @@ impl<'a> Seek for BufWriter<'a> { /// # Examples /// /// ``` +/// # #![feature(old_io)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs index 6dfb54fd66c..ac908c529dc 100644 --- a/src/libstd/old_io/mod.rs +++ b/src/libstd/old_io/mod.rs @@ -48,6 +48,7 @@ //! * Read lines from stdin //! //! ```rust +//! # #![feature(old_io, old_path)] //! use std::old_io as io; //! use std::old_io::*; //! @@ -60,6 +61,7 @@ //! * Read a complete file //! //! ```rust +//! # #![feature(old_io, old_path)] //! use std::old_io::*; //! use std::old_path::Path; //! @@ -69,6 +71,7 @@ //! * Write a line to a file //! //! ```rust +//! # #![feature(old_io, old_path)] //! # #![allow(unused_must_use)] //! use std::old_io::*; //! use std::old_path::Path; @@ -82,6 +85,7 @@ //! * Iterate over the lines of a file //! //! ```rust,no_run +//! # #![feature(old_io, old_path)] //! use std::old_io::*; //! use std::old_path::Path; //! @@ -95,6 +99,7 @@ //! * Pull the lines of a file into a vector of strings //! //! ```rust,no_run +//! # #![feature(old_io, old_path)] //! use std::old_io::*; //! use std::old_path::Path; //! @@ -106,6 +111,7 @@ //! * Make a simple TCP client connection and request //! //! ```rust +//! # #![feature(old_io)] //! # #![allow(unused_must_use)] //! use std::old_io::*; //! @@ -122,6 +128,7 @@ //! * Make a simple TCP server //! //! ```rust +//! # #![feature(old_io)] //! # fn main() { } //! # fn foo() { //! # #![allow(dead_code)] @@ -186,6 +193,7 @@ //! If you wanted to handle the error though you might write: //! //! ```rust +//! # #![feature(old_io, old_path)] //! # #![allow(unused_must_use)] //! use std::old_io::*; //! use std::old_path::Path; @@ -221,6 +229,7 @@ //! If you wanted to read several `u32`s from a file and return their product: //! //! ```rust +//! # #![feature(old_io, old_path)] //! use std::old_io::*; //! use std::old_path::Path; //! @@ -948,6 +957,7 @@ unsafe fn slice_vec_capacity<'a, T>(v: &'a mut Vec<T>, start: uint, end: uint) - /// # Examples /// /// ``` +/// # #![feature(old_io)] /// use std::old_io as io; /// use std::old_io::*; /// use std::old_io::util::LimitReader; @@ -1282,6 +1292,7 @@ impl<'a> Writer for &'a mut (Writer+'a) { /// # Examples /// /// ``` +/// # #![feature(old_io)] /// use std::old_io::util::TeeReader; /// use std::old_io::*; /// @@ -1407,6 +1418,7 @@ pub trait Buffer: Reader { /// # Examples /// /// ``` + /// # #![feature(old_io)] /// use std::old_io::*; /// /// let mut reader = BufReader::new(b"hello\nworld"); @@ -1631,6 +1643,7 @@ impl<'a, T, A: ?Sized + Acceptor<T>> Iterator for IncomingConnections<'a, A> { /// # Examples /// /// ``` +/// # #![feature(old_io)] /// use std::old_io as io; /// /// let eof = io::standard_error(io::EndOfFile); @@ -1719,6 +1732,7 @@ pub enum FileType { /// # Examples /// /// ```no_run +/// # #![feature(old_io, old_path)] /// /// use std::old_io::fs::PathExtensions; /// use std::old_path::Path; diff --git a/src/libstd/old_io/net/ip.rs b/src/libstd/old_io/net/ip.rs index 077a5072570..f7953ac51b8 100644 --- a/src/libstd/old_io/net/ip.rs +++ b/src/libstd/old_io/net/ip.rs @@ -414,6 +414,7 @@ pub struct ParseError; /// Some examples: /// /// ```rust,no_run +/// # #![feature(old_io, core)] /// # #![allow(unused_must_use)] /// /// use std::old_io::{TcpStream, TcpListener}; diff --git a/src/libstd/old_io/net/pipe.rs b/src/libstd/old_io/net/pipe.rs index 77efedbc327..f9e5ae71e12 100644 --- a/src/libstd/old_io/net/pipe.rs +++ b/src/libstd/old_io/net/pipe.rs @@ -54,6 +54,7 @@ impl UnixStream { /// # Examples /// /// ``` + /// # #![feature(old_io, old_path, io)] /// # #![allow(unused_must_use)] /// use std::old_io::net::pipe::UnixStream; /// use std::old_io::*; @@ -181,6 +182,7 @@ impl UnixListener { /// # Examples /// /// ``` + /// # #![feature(old_io, io, old_path)] /// # fn foo() { /// use std::old_io::net::pipe::UnixListener; /// use std::old_io::*; diff --git a/src/libstd/old_io/net/tcp.rs b/src/libstd/old_io/net/tcp.rs index dbf3c4a4b1e..75f786f0bb1 100644 --- a/src/libstd/old_io/net/tcp.rs +++ b/src/libstd/old_io/net/tcp.rs @@ -41,6 +41,7 @@ use sys_common; /// # Examples /// /// ```no_run +/// # #![feature(old_io, io)] /// use std::old_io::*; /// /// { @@ -133,6 +134,7 @@ impl TcpStream { /// # Examples /// /// ```no_run + /// # #![feature(old_io, std_misc)] /// # #![allow(unused_must_use)] /// use std::old_io::*; /// use std::time::Duration; @@ -278,6 +280,7 @@ impl sys_common::AsInner<TcpStreamImp> for TcpStream { /// # Examples /// /// ``` +/// # #![feature(old_io)] /// # fn foo() { /// use std::old_io::*; /// use std::thread; @@ -374,6 +377,7 @@ impl TcpAcceptor { /// # Examples /// /// ```no_run + /// # #![feature(old_io, io)] /// use std::old_io::*; /// /// let mut a = TcpListener::bind("127.0.0.1:8482").listen().unwrap(); @@ -417,6 +421,7 @@ impl TcpAcceptor { /// # Examples /// /// ``` + /// # #![feature(old_io, io)] /// use std::old_io::*; /// use std::thread; /// diff --git a/src/libstd/old_io/net/udp.rs b/src/libstd/old_io/net/udp.rs index 97ef3da2f36..3aa811974b3 100644 --- a/src/libstd/old_io/net/udp.rs +++ b/src/libstd/old_io/net/udp.rs @@ -31,6 +31,7 @@ use sys_common; /// # Examples /// /// ```rust,no_run +/// # #![feature(old_io)] /// # #![allow(unused_must_use)] /// /// use std::old_io::net::udp::UdpSocket; diff --git a/src/libstd/old_io/pipe.rs b/src/libstd/old_io/pipe.rs index b2b28453c89..0b555e2f0ff 100644 --- a/src/libstd/old_io/pipe.rs +++ b/src/libstd/old_io/pipe.rs @@ -46,6 +46,7 @@ impl PipeStream { /// # Examples /// /// ```{rust,no_run} + /// # #![feature(old_io, libc, io)] /// # #![allow(unused_must_use)] /// extern crate libc; /// diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs index 54fd20f45e2..d7ede451fb8 100644 --- a/src/libstd/old_io/process.rs +++ b/src/libstd/old_io/process.rs @@ -61,6 +61,7 @@ use thread; /// # Examples /// /// ```should_fail +/// # #![feature(old_io)] /// use std::old_io::*; /// /// let mut child = match Command::new("/bin/cat").arg("file.txt").spawn() { @@ -164,6 +165,7 @@ pub type EnvMap = HashMap<EnvKey, CString>; /// to be changed (for example, by adding arguments) prior to spawning: /// /// ``` +/// # #![feature(old_io)] /// use std::old_io::*; /// /// let mut process = match Command::new("sh").arg("-c").arg("echo hello").spawn() { @@ -365,6 +367,7 @@ impl Command { /// # Examples /// /// ``` + /// # #![feature(old_io, core)] /// use std::old_io::Command; /// /// let output = match Command::new("cat").arg("foot.txt").output() { @@ -386,6 +389,7 @@ impl Command { /// # Examples /// /// ``` + /// # #![feature(old_io)] /// use std::old_io::Command; /// /// let status = match Command::new("ls").status() { @@ -660,6 +664,7 @@ impl Process { /// # Examples /// /// ```no_run + /// # #![feature(old_io, io)] /// use std::old_io::{Command, IoResult}; /// use std::old_io::process::ProcessExit; /// diff --git a/src/libstd/old_io/stdio.rs b/src/libstd/old_io/stdio.rs index a1c8630e0ec..ef811f832b3 100644 --- a/src/libstd/old_io/stdio.rs +++ b/src/libstd/old_io/stdio.rs @@ -18,6 +18,7 @@ //! # Examples //! //! ```rust +//! # #![feature(old_io)] //! # #![allow(unused_must_use)] //! use std::old_io; //! use std::old_io::*; @@ -140,6 +141,7 @@ impl StdinReader { /// # Examples /// /// ``` + /// # #![feature(old_io)] /// use std::old_io; /// use std::old_io::*; /// diff --git a/src/libstd/old_io/tempfile.rs b/src/libstd/old_io/tempfile.rs index 90b3d1004c0..c0f6ddaaef7 100644 --- a/src/libstd/old_io/tempfile.rs +++ b/src/libstd/old_io/tempfile.rs @@ -29,6 +29,7 @@ use string::String; /// # Examples /// /// ```no_run +/// # #![feature(old_io, old_path)] /// use std::old_io::*; /// use std::old_path::{Path, GenericPath}; /// diff --git a/src/libstd/old_io/timer.rs b/src/libstd/old_io/timer.rs index 65c62a99335..f8cba044443 100644 --- a/src/libstd/old_io/timer.rs +++ b/src/libstd/old_io/timer.rs @@ -31,6 +31,7 @@ use sys::timer::Timer as TimerImp; /// # Examples /// /// ``` +/// # #![feature(old_io, std_misc)] /// # fn foo() { /// use std::old_io::Timer; /// use std::time::Duration; @@ -54,6 +55,7 @@ use sys::timer::Timer as TimerImp; /// the `old_io::timer` module. /// /// ``` +/// # #![feature(old_io, std_misc)] /// # fn foo() { /// use std::old_io::timer; /// use std::time::Duration; @@ -116,6 +118,7 @@ impl Timer { /// # Examples /// /// ``` + /// # #![feature(old_io, std_misc)] /// use std::old_io::Timer; /// use std::time::Duration; /// @@ -129,6 +132,7 @@ impl Timer { /// ``` /// /// ``` + /// # #![feature(old_io, std_misc)] /// use std::old_io::Timer; /// use std::time::Duration; /// @@ -168,6 +172,7 @@ impl Timer { /// # Examples /// /// ``` + /// # #![feature(old_io, std_misc)] /// use std::old_io::Timer; /// use std::time::Duration; /// @@ -187,6 +192,7 @@ impl Timer { /// ``` /// /// ``` + /// # #![feature(old_io, std_misc)] /// use std::old_io::Timer; /// use std::time::Duration; /// diff --git a/src/libstd/old_path/mod.rs b/src/libstd/old_path/mod.rs index 909fa4062b6..50bda04b5d0 100644 --- a/src/libstd/old_path/mod.rs +++ b/src/libstd/old_path/mod.rs @@ -49,6 +49,7 @@ //! ## Examples //! //! ```rust +//! # #![feature(old_path, old_io)] //! use std::old_io::fs::PathExtensions; //! use std::old_path::{Path, GenericPath}; //! @@ -143,6 +144,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -168,6 +170,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -191,6 +194,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -209,6 +213,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -224,6 +229,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -240,6 +246,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -259,6 +266,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -277,6 +285,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -293,6 +302,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -313,6 +323,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -329,6 +340,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -349,6 +361,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -377,6 +390,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -398,6 +412,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -426,6 +441,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -445,6 +461,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -472,6 +489,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -523,6 +541,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -549,6 +568,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -574,6 +594,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -594,6 +615,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -610,6 +632,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -635,6 +658,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -665,6 +689,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -683,6 +708,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -709,6 +735,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -732,6 +759,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -750,6 +778,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -769,6 +798,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -789,6 +819,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} @@ -806,6 +837,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// # foo(); /// # #[cfg(windows)] fn foo() {} diff --git a/src/libstd/old_path/windows.rs b/src/libstd/old_path/windows.rs index cea2c238ece..4f367e30526 100644 --- a/src/libstd/old_path/windows.rs +++ b/src/libstd/old_path/windows.rs @@ -605,6 +605,7 @@ impl Path { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// println!("{}", Path::new(r"C:\some\path").display()); /// ``` @@ -620,6 +621,7 @@ impl Path { /// # Examples /// /// ``` + /// # #![feature(old_path)] /// use std::old_path::{Path, GenericPath}; /// let path = Path::new_opt(r"C:\some\path"); /// diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 3870b8614ff..6296cd9554c 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -125,6 +125,7 @@ pub const TMPBUF_SZ : uint = 1000; /// # Examples /// /// ``` +/// # #![feature(os, old_path)] /// use std::os; /// use std::old_path::{Path, GenericPath}; /// @@ -146,6 +147,7 @@ pub fn getcwd() -> IoResult<Path> { /// # Examples /// /// ``` +/// # #![feature(os)] /// use std::os; /// /// // We will iterate through the references to the element returned by os::env(); @@ -182,6 +184,7 @@ pub fn env_as_bytes() -> Vec<(Vec<u8>, Vec<u8>)> { /// # Examples /// /// ``` +/// # #![feature(os)] /// use std::os; /// /// let key = "HOME"; @@ -224,6 +227,7 @@ fn byteify(s: OsString) -> Vec<u8> { /// # Examples /// /// ``` +/// # #![feature(os)] /// use std::os; /// /// let key = "KEY"; @@ -265,6 +269,7 @@ pub fn unsetenv(n: &str) { /// # Examples /// /// ``` +/// # #![feature(old_path, os)] /// use std::os; /// use std::old_path::{Path, GenericPath}; /// @@ -298,6 +303,7 @@ pub fn split_paths<T: BytesContainer>(unparsed: T) -> Vec<Path> { /// # Examples /// /// ``` +/// # #![feature(os, old_path, core)] /// use std::os; /// use std::old_path::Path; /// @@ -359,6 +365,7 @@ pub fn dll_filename(base: &str) -> String { /// # Examples /// /// ``` +/// # #![feature(os, old_path)] /// use std::os; /// use std::old_path::{Path, GenericPath}; /// @@ -380,6 +387,7 @@ pub fn self_exe_name() -> Option<Path> { /// # Examples /// /// ``` +/// # #![feature(os, old_path)] /// use std::os; /// use std::old_path::{Path, GenericPath}; /// @@ -410,6 +418,7 @@ pub fn self_exe_path() -> Option<Path> { /// # Examples /// /// ``` +/// # #![feature(os, old_path)] /// use std::os; /// use std::old_path::{Path, GenericPath}; /// @@ -501,6 +510,7 @@ pub fn tmpdir() -> Path { /// # Examples /// /// ``` +/// # #![feature(os, old_path)] /// use std::os; /// use std::old_path::{Path, GenericPath}; /// @@ -533,6 +543,7 @@ pub fn make_absolute(p: &Path) -> IoResult<Path> { /// # Examples /// /// ``` +/// # #![feature(os, old_path)] /// use std::os; /// use std::old_path::{Path, GenericPath}; /// @@ -555,6 +566,7 @@ pub fn errno() -> i32 { /// # Examples /// /// ``` +/// # #![feature(os)] /// use std::os; /// /// // Same as println!("{}", last_os_error()); @@ -751,6 +763,7 @@ extern "system" { /// # Examples /// /// ``` +/// # #![feature(os)] /// use std::os; /// /// // Prints each argument on a separate line diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 69053252ed1..656ca980624 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -58,6 +58,7 @@ //! # Examples //! //! ```rust +//! # #![feature(rand)] //! use std::rand; //! use std::rand::Rng; //! @@ -68,6 +69,7 @@ //! ``` //! //! ```rust +//! # #![feature(rand)] //! use std::rand; //! //! let tuple = rand::random::<(f64, char)>(); @@ -92,6 +94,7 @@ //! multiply this fraction by 4. //! //! ``` +//! # #![feature(rand)] //! use std::rand; //! use std::rand::distributions::{IndependentSample, Range}; //! @@ -134,6 +137,7 @@ //! [Monty Hall Problem]: http://en.wikipedia.org/wiki/Monty_Hall_problem //! //! ``` +//! # #![feature(rand)] //! use std::rand; //! use std::rand::Rng; //! use std::rand::distributions::{IndependentSample, Range}; @@ -384,6 +388,7 @@ impl Rng for ThreadRng { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// /// let x: u8 = rand::random(); @@ -400,6 +405,7 @@ impl Rng for ThreadRng { /// Caching the thread local random number generator: /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::Rng; /// @@ -427,6 +433,7 @@ pub fn random<T: Rand>() -> T { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand::{thread_rng, sample}; /// /// let mut rng = thread_rng(); diff --git a/src/libstd/rand/reader.rs b/src/libstd/rand/reader.rs index 5231b122b9e..d3a8fa864fc 100644 --- a/src/libstd/rand/reader.rs +++ b/src/libstd/rand/reader.rs @@ -24,6 +24,7 @@ use result::Result::{Ok, Err}; /// # Examples /// /// ``` +/// # #![feature(rand, old_io)] /// use std::rand::{reader, Rng}; /// use std::old_io::MemReader; /// diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 4430cc3b0af..69c5267ab69 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -69,6 +69,7 @@ pub struct Condvar { inner: Box<StaticCondvar> } /// # Examples /// /// ``` +/// # #![feature(std_misc)] /// 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 ee9bcd3dd89..3c7fecb7515 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -14,6 +14,7 @@ //! # Examples //! //! ``` +//! # #![feature(std_misc)] //! use std::sync::Future; //! //! // a fake, for now diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 123dad978f5..cb8acf14e13 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -119,6 +119,7 @@ //! after 10 seconds no matter what: //! //! ```no_run +//! # #![feature(std_misc, old_io)] //! use std::sync::mpsc::channel; //! use std::old_io::timer::Timer; //! use std::time::Duration; @@ -143,6 +144,7 @@ //! has been inactive for 5 seconds: //! //! ```no_run +//! # #![feature(std_misc, old_io)] //! use std::sync::mpsc::channel; //! use std::old_io::timer::Timer; //! use std::time::Duration; diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index b5739c36aa9..0f936641cdc 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -27,6 +27,7 @@ //! # Examples //! //! ```rust +//! # #![feature(std_misc)] //! use std::sync::mpsc::channel; //! //! let (tx1, rx1) = channel(); @@ -119,6 +120,7 @@ impl Select { /// # Examples /// /// ``` + /// # #![feature(std_misc)] /// use std::sync::mpsc::Select; /// /// let select = Select::new(); diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 130fd1d7dc8..2bf75cf1d37 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -85,6 +85,7 @@ use fmt; /// To recover from a poisoned mutex: /// /// ``` +/// # #![feature(std_misc)] /// use std::sync::{Arc, Mutex}; /// use std::thread; /// @@ -136,6 +137,7 @@ unsafe impl<T: Send> Sync for Mutex<T> { } /// # Examples /// /// ``` +/// # #![feature(std_misc)] /// 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 368e88e4e8b..6e94db6d753 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -77,6 +77,7 @@ unsafe impl<T: Send + Sync> Sync for RwLock<T> {} /// # Examples /// /// ``` +/// # #![feature(std_misc)] /// 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 2f9873950b6..059cce57245 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -25,6 +25,7 @@ use sync::{Mutex, Condvar}; /// # Examples /// /// ``` +/// # #![feature(std_misc)] /// use std::sync::Semaphore; /// /// // Create a semaphore that represents 5 resources diff --git a/src/libstd/sync/task_pool.rs b/src/libstd/sync/task_pool.rs index 8a1946b86ab..51cf70e615b 100644 --- a/src/libstd/sync/task_pool.rs +++ b/src/libstd/sync/task_pool.rs @@ -61,6 +61,7 @@ impl<'a> Drop for Sentinel<'a> { /// # Examples /// /// ``` +/// # #![feature(std_misc, core)] /// use std::sync::TaskPool; /// use std::iter::AdditiveIterator; /// use std::sync::mpsc::channel; diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs index 86e6c059a70..34b581f7fda 100644 --- a/src/libstd/thread_local/scoped.rs +++ b/src/libstd/thread_local/scoped.rs @@ -24,6 +24,7 @@ //! # Examples //! //! ``` +//! # #![feature(std_misc)] //! scoped_thread_local!(static FOO: u32); //! //! // Initially each scoped slot is empty. @@ -142,6 +143,7 @@ impl<T> Key<T> { /// # Examples /// /// ``` + /// # #![feature(std_misc)] /// scoped_thread_local!(static FOO: u32); /// /// FOO.set(&100, || { @@ -194,6 +196,7 @@ impl<T> Key<T> { /// # Examples /// /// ```no_run + /// # #![feature(std_misc)] /// scoped_thread_local!(static FOO: u32); /// /// FOO.with(|slot| { |
