Skip to content

Commit cea63ec

Browse files
committed
Minor doc fixes in various places
1 parent 5d2eddd commit cea63ec

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

src/doc/rust.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ See [Break expressions](#break-expressions) and [Continue expressions](#continue
29432943
break_expr : "break" [ lifetime ];
29442944
~~~~
29452945

2946-
A `break` expression has an optional `label`.
2946+
A `break` expression has an optional _label_.
29472947
If the label is absent, then executing a `break` expression immediately terminates the innermost loop enclosing it.
29482948
It is only permitted in the body of a loop.
29492949
If the label is present, then `break foo` terminates the loop with label `foo`,
@@ -2956,7 +2956,7 @@ but must enclose it.
29562956
continue_expr : "continue" [ lifetime ];
29572957
~~~~
29582958

2959-
A `continue` expression has an optional `label`.
2959+
A `continue` expression has an optional _label_.
29602960
If the label is absent,
29612961
then executing a `continue` expression immediately terminates the current iteration of the innermost loop enclosing it,
29622962
returning control to the loop *head*.
@@ -3115,7 +3115,7 @@ let x: List<int> = Cons(10, box Cons(11, box Nil));
31153115
31163116
match x {
31173117
Cons(a, box Cons(b, _)) => {
3118-
process_pair(a,b);
3118+
process_pair(a, b);
31193119
}
31203120
Cons(10, _) => {
31213121
process_ten();
@@ -3329,8 +3329,8 @@ order specified by the tuple type.
33293329
An example of a tuple type and its use:
33303330

33313331
~~~~
3332-
type Pair<'a> = (int,&'a str);
3333-
let p: Pair<'static> = (10,"hello");
3332+
type Pair<'a> = (int, &'a str);
3333+
let p: Pair<'static> = (10, "hello");
33343334
let (a, b) = p;
33353335
assert!(b != "world");
33363336
~~~~

src/doc/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ fn main() {
26022602
~~~
26032603

26042604
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
2605-
`TotalOrd`, `Encodable` `Decodable`, `Clone`,
2605+
`TotalOrd`, `Encodable`, `Decodable`, `Clone`,
26062606
`Hash`, `Rand`, `Default`, `Zero`, `FromPrimitive` and `Show`.
26072607

26082608
# Crates and the module system

src/libcore/bool.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
//! Implementations of the following traits:
1616
//!
1717
//! * `Not`
18+
//! * `BitAnd`
19+
//! * `BitOr`
20+
//! * `BitXor`
1821
//! * `Ord`
1922
//! * `TotalOrd`
2023
//! * `Eq`
24+
//! * `TotalEq`
2125
//! * `Default`
22-
//! * `Zero`
2326
//!
2427
//! A `to_bit` conversion function.
2528

src/libcore/num/mod.rs

+21-17
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Numeric traits and functions for generic mathematics
1212
//!
1313
//! These are implemented for the primitive numeric types in `std::{u8, u16,
14-
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64, float}`.
14+
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`.
1515
1616
#![allow(missing_doc)]
1717

@@ -97,7 +97,7 @@ pub trait One: Mul<Self, Self> {
9797
pub trait Signed: Num + Neg<Self> {
9898
/// Computes the absolute value.
9999
///
100-
/// For float, f32, and f64, `NaN` will be returned if the number is `NaN`.
100+
/// For `f32` and `f64`, `NaN` will be returned if the number is `NaN`.
101101
fn abs(&self) -> Self;
102102

103103
/// The positive difference of two numbers.
@@ -108,15 +108,17 @@ pub trait Signed: Num + Neg<Self> {
108108

109109
/// Returns the sign of the number.
110110
///
111-
/// For `float`, `f32`, `f64`:
112-
/// * `1.0` if the number is positive, `+0.0` or `INFINITY`
113-
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
114-
/// * `NaN` if the number is `NaN`
111+
/// For `f32` and `f64`:
112+
///
113+
/// * `1.0` if the number is positive, `+0.0` or `INFINITY`
114+
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
115+
/// * `NaN` if the number is `NaN`
115116
///
116117
/// For `int`:
117-
/// * `0` if the number is zero
118-
/// * `1` if the number is positive
119-
/// * `-1` if the number is negative
118+
///
119+
/// * `0` if the number is zero
120+
/// * `1` if the number is positive
121+
/// * `-1` if the number is negative
120122
fn signum(&self) -> Self;
121123

122124
/// 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<Self> {
128130

129131
/// Computes the absolute value.
130132
///
131-
/// For float, f32, and f64, `NaN` will be returned if the number is `NaN`
133+
/// For `f32` and `f64`, `NaN` will be returned if the number is `NaN`
132134
#[inline(always)]
133135
pub fn abs<T: Signed>(value: T) -> T {
134136
value.abs()
@@ -145,15 +147,17 @@ pub fn abs_sub<T: Signed>(x: T, y: T) -> T {
145147

146148
/// Returns the sign of the number.
147149
///
148-
/// For float, f32, f64:
149-
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
150-
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
151-
/// - `NAN` if the number is `NAN`
150+
/// For `f32` and `f64`:
151+
///
152+
/// * `1.0` if the number is positive, `+0.0` or `INFINITY`
153+
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
154+
/// * `NaN` if the number is `NaN`
152155
///
153156
/// For int:
154-
/// - `0` if the number is zero
155-
/// - `1` if the number is positive
156-
/// - `-1` if the number is negative
157+
///
158+
/// * `0` if the number is zero
159+
/// * `1` if the number is positive
160+
/// * `-1` if the number is negative
157161
#[inline(always)] pub fn signum<T: Signed>(value: T) -> T { value.signum() }
158162

159163
/// A trait for values which cannot be negative

src/libstd/num/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Numeric traits and functions for generic mathematics
1212
//!
1313
//! These are implemented for the primitive numeric types in `std::{u8, u16,
14-
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64, float}`.
14+
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`.
1515
1616
#![allow(missing_doc)]
1717

0 commit comments

Comments
 (0)