diff --git a/src/doc/rust.md b/src/doc/rust.md index 4986ad1ba99f5..c312f2c1fe511 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -2943,7 +2943,7 @@ See [Break expressions](#break-expressions) and [Continue expressions](#continue break_expr : "break" [ lifetime ]; ~~~~ -A `break` expression has an optional `label`. +A `break` expression has an optional _label_. If the label is absent, then executing a `break` expression immediately terminates the innermost loop enclosing it. It is only permitted in the body of a loop. If the label is present, then `break foo` terminates the loop with label `foo`, @@ -2956,7 +2956,7 @@ but must enclose it. continue_expr : "continue" [ lifetime ]; ~~~~ -A `continue` expression has an optional `label`. +A `continue` expression has an optional _label_. If the label is absent, then executing a `continue` expression immediately terminates the current iteration of the innermost loop enclosing it, returning control to the loop *head*. @@ -3115,7 +3115,7 @@ let x: List = Cons(10, box Cons(11, box Nil)); match x { Cons(a, box Cons(b, _)) => { - process_pair(a,b); + process_pair(a, b); } Cons(10, _) => { process_ten(); @@ -3329,8 +3329,8 @@ order specified by the tuple type. An example of a tuple type and its use: ~~~~ -type Pair<'a> = (int,&'a str); -let p: Pair<'static> = (10,"hello"); +type Pair<'a> = (int, &'a str); +let p: Pair<'static> = (10, "hello"); let (a, b) = p; assert!(b != "world"); ~~~~ diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index ad77b90e79b70..4e3688a060d21 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -2602,7 +2602,7 @@ fn main() { ~~~ The full list of derivable traits is `Eq`, `TotalEq`, `Ord`, -`TotalOrd`, `Encodable` `Decodable`, `Clone`, +`TotalOrd`, `Encodable`, `Decodable`, `Clone`, `Hash`, `Rand`, `Default`, `Zero`, `FromPrimitive` and `Show`. # Crates and the module system diff --git a/src/libcore/bool.rs b/src/libcore/bool.rs index 0f632f4d4d095..2a44d1417198b 100644 --- a/src/libcore/bool.rs +++ b/src/libcore/bool.rs @@ -15,11 +15,14 @@ //! Implementations of the following traits: //! //! * `Not` +//! * `BitAnd` +//! * `BitOr` +//! * `BitXor` //! * `Ord` //! * `TotalOrd` //! * `Eq` +//! * `TotalEq` //! * `Default` -//! * `Zero` //! //! A `to_bit` conversion function. diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 47be5df67eabd..03eca8b12b825 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -11,7 +11,7 @@ //! Numeric traits and functions for generic mathematics //! //! These are implemented for the primitive numeric types in `std::{u8, u16, -//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64, float}`. +//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`. #![allow(missing_doc)] @@ -97,7 +97,7 @@ pub trait One: Mul { pub trait Signed: Num + Neg { /// Computes the absolute value. /// - /// For float, f32, and f64, `NaN` will be returned if the number is `NaN`. + /// For `f32` and `f64`, `NaN` will be returned if the number is `NaN`. fn abs(&self) -> Self; /// The positive difference of two numbers. @@ -108,15 +108,17 @@ pub trait Signed: Num + Neg { /// Returns the sign of the number. /// - /// For `float`, `f32`, `f64`: - /// * `1.0` if the number is positive, `+0.0` or `INFINITY` - /// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` - /// * `NaN` if the number is `NaN` + /// For `f32` and `f64`: + /// + /// * `1.0` if the number is positive, `+0.0` or `INFINITY` + /// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// * `NaN` if the number is `NaN` /// /// For `int`: - /// * `0` if the number is zero - /// * `1` if the number is positive - /// * `-1` if the number is negative + /// + /// * `0` if the number is zero + /// * `1` if the number is positive + /// * `-1` if the number is negative fn signum(&self) -> Self; /// Returns true if the number is positive and false if the number is zero or negative. @@ -128,7 +130,7 @@ pub trait Signed: Num + Neg { /// Computes the absolute value. /// -/// For float, f32, and f64, `NaN` will be returned if the number is `NaN` +/// For `f32` and `f64`, `NaN` will be returned if the number is `NaN` #[inline(always)] pub fn abs(value: T) -> T { value.abs() @@ -145,15 +147,17 @@ pub fn abs_sub(x: T, y: T) -> T { /// Returns the sign of the number. /// -/// For float, f32, f64: -/// - `1.0` if the number is positive, `+0.0` or `INFINITY` -/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` -/// - `NAN` if the number is `NAN` +/// For `f32` and `f64`: +/// +/// * `1.0` if the number is positive, `+0.0` or `INFINITY` +/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` +/// * `NaN` if the number is `NaN` /// /// For int: -/// - `0` if the number is zero -/// - `1` if the number is positive -/// - `-1` if the number is negative +/// +/// * `0` if the number is zero +/// * `1` if the number is positive +/// * `-1` if the number is negative #[inline(always)] pub fn signum(value: T) -> T { value.signum() } /// A trait for values which cannot be negative diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 3178fcbd66fdb..40167718236ef 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -11,7 +11,7 @@ //! Numeric traits and functions for generic mathematics //! //! These are implemented for the primitive numeric types in `std::{u8, u16, -//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64, float}`. +//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`. #![allow(missing_doc)]