Skip to content

Commit 87b4c6e

Browse files
committed
Minor review edits.
1 parent 7166c5f commit 87b4c6e

File tree

6 files changed

+33
-23
lines changed

6 files changed

+33
-23
lines changed

src/paths.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn bar() {
185185

186186
### `Self`
187187

188-
`Self` with a capital "S" is used to refer to the implementing type within
188+
`Self`, with a capital "S", is used to refer to the implementing type within
189189
[traits] and [implementations].
190190

191191
`Self` can only be used as the first segment, without a preceding `::`.

src/types-redirect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var fragments = {
44
"#boolean-type": "types/boolean.html",
55
"#numeric-types": "types/numeric.html",
6-
"#machine-types": "types/numeric.html#machine-types",
6+
"#machine-types": "types/numeric.html",
77
"#machine-dependent-integer-types": "types/numeric.html#machine-dependent-integer-types",
88
"#textual-types": "types/textual.html",
99
"#never-type": "types/never.html",

src/types.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The list of types is:
1515
* [Boolean]`true` or `false`
1616
* [Numeric] — integer and float
1717
* [Textual]`char` and `str`
18-
* [Never]`!` — a type with no value
18+
* [Never]`!` — a type with no values
1919
* Sequence types:
2020
* [Tuple]
2121
* [Array]
@@ -35,7 +35,6 @@ The list of types is:
3535
* [Trait objects]
3636
* [Impl trait]
3737

38-
3938
## Type expressions
4039

4140
> **<sup>Syntax</sup>**\
@@ -90,7 +89,7 @@ require this disambiguation use the [_TypeNoBounds_] rule instead of
9089

9190
```rust
9291
# use std::any::Any;
93-
type T<'a> = &'a(Any + Send);
92+
type T<'a> = &'a (dyn Any + Send);
9493
```
9594

9695
### Inferred type

src/types/array.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
> &nbsp;&nbsp; `[` [_Type_] `;` [_Expression_] `]`
66
77
An array is a fixed-size sequence of `N` elements of type `T`. The array type
8-
is written as `[T; N]`.
9-
10-
An array can be allocated on either the stack or the heap. The size is an
11-
expression that evaluates to a [`usize`].
8+
is written as `[T; N]`. The size is an expression that evaluates to a
9+
[`usize`].
1210

1311
Examples:
1412

src/types/function-pointer.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ Function pointer types, written using the `fn` keyword, refer to a function
2424
whose identity is not necessarily known at compile-time. They can be created
2525
via a coercion from both [function items] and non-capturing [closures].
2626

27-
A function pointer type consists of a possibly-empty set of function-type
28-
modifiers (such as `unsafe` or `extern`), a sequence of input types and an
29-
output type.
27+
The `unsafe` qualifier indicates that the type's value is an [unsafe
28+
function], and the `extern` qualifier indicates it is an [extern function].
3029

3130
Variadic parameters can only be specified with [`extern`] function types with
3231
the `"C"` or `"cdecl"` calling convention.
@@ -52,4 +51,6 @@ x = bo(5,7);
5251
[_Type_]: types.html#type-expressions
5352
[`extern`]: items/external-blocks.html
5453
[closures]: types/closure.html
54+
[extern function]: items/functions.html#extern-functions
5555
[function items]: types/function-item.html
56+
[unsafe function]: unsafe-functions.html

src/types/numeric.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
# Numeric types
22

3-
## Machine types
3+
## Integer types
44

5-
The machine types are the following:
5+
The unsigned integer types consist of:
66

7-
* The unsigned word types `u8`, `u16`, `u32`, `u64`, and `u128` with values
8-
drawn from the integer intervals [0, 2^8 - 1], [0, 2^16 - 1], [0, 2^32 - 1],
9-
[0, 2^64 - 1], and [0, 2^128 - 1] respectively.
7+
Type | Minimum | Maximum
8+
-------|---------|-------------------
9+
`u8` | 0 | 2<sup>8</sup>-1
10+
`u16` | 0 | 2<sup>16</sup>-1
11+
`u32` | 0 | 2<sup>32</sup>-1
12+
`u64` | 0 | 2<sup>64</sup>-1
13+
`u128` | 0 | 2<sup>128</sup>-1
1014

11-
* The signed two's complement word types `i8`, `i16`, `i32`, `i64`, and `i128`,
12-
with values drawn from the integer intervals [-(2^7), 2^7 - 1],
13-
[-(2^15), 2^15 - 1], [-(2^31), 2^31 - 1], [-(2^63), 2^63 - 1], and
14-
[-(2^127), 2^127 - 1] respectively.
15+
The signed two's complement integer types consist of:
1516

16-
* The IEEE 754-2008 "binary32" and "binary64" floating-point types: `f32` and
17-
`f64`, respectively.
17+
Type | Minimum | Maximum
18+
-------|--------------------|-------------------
19+
`i8` | -(2<sup>7</sup>) | 2<sup>7</sup>-1
20+
`i16` | -(2<sup>15</sup>) | 2<sup>15</sup>-1
21+
`i32` | -(2<sup>31</sup>) | 2<sup>31</sup>-1
22+
`i64` | -(2<sup>63</sup>) | 2<sup>63</sup>-1
23+
`i128` | -(2<sup>127</sup>) | 2<sup>127</sup>-1
24+
25+
26+
## Floating-point types
27+
28+
The IEEE 754-2008 "binary32" and "binary64" floating-point types are `f32` and
29+
`f64`, respectively.
1830

1931
## Machine-dependent integer types
2032

0 commit comments

Comments
 (0)