@@ -603,7 +603,7 @@ mod b {
603
603
```
604
604
605
605
* Paths starting with the keyword ` super ` begin resolution relative to the
606
- parent module. Each further identifier must resolve to an item
606
+ parent module. Each further identifier must resolve to an item.
607
607
608
608
``` rust
609
609
mod a {
@@ -985,7 +985,7 @@ top of [modules](#modules) and [blocks](#blocks).
985
985
986
986
Use declarations support a number of convenient shortcuts:
987
987
988
- * Rebinding the target name as a new local name, using the syntax ` use p::q::r as x; ` .
988
+ * Rebinding the target name as a new local name, using the syntax ` use p::q::r as x; `
989
989
* Simultaneously binding a list of paths differing only in their final element,
990
990
using the glob-like brace syntax ` use a::b::{c,d,e,f}; `
991
991
* Binding all paths matching a given prefix, using the asterisk wildcard syntax
@@ -1091,7 +1091,7 @@ set of *input* [*slots*](#memory-slots) as parameters, through which the caller
1091
1091
passes arguments into the function, and an * output* [ * slot* ] ( #memory-slots )
1092
1092
through which the function passes results back to the caller.
1093
1093
1094
- A function may also be copied into a first class * value* , in which case the
1094
+ A function may also be copied into a first- class * value* , in which case the
1095
1095
value has the corresponding [ * function type* ] ( #function-types ) , and can be used
1096
1096
otherwise exactly as a function item (with a minor additional cost of calling
1097
1097
the function indirectly).
@@ -1224,7 +1224,7 @@ the guarantee that these issues are never caused by safe code.
1224
1224
* A value other than ` false ` (0) or ` true ` (1) in a ` bool `
1225
1225
* A discriminant in an ` enum ` not included in the type definition
1226
1226
* A value in a ` char ` which is a surrogate or above ` char::MAX `
1227
- * non -UTF-8 byte sequences in a ` str `
1227
+ * Non -UTF-8 byte sequences in a ` str `
1228
1228
* Unwinding into Rust from foreign code or unwinding from Rust into foreign
1229
1229
code. Rust's failure system is not compatible with exception handling in
1230
1230
other languages. Unwinding must be caught and handled at FFI boundaries.
@@ -1827,7 +1827,7 @@ accesses in two cases:
1827
1827
1828
1828
These two cases are surprisingly powerful for creating module hierarchies
1829
1829
exposing public APIs while hiding internal implementation details. To help
1830
- explain, here's a few use cases and what they would entail.
1830
+ explain, here's a few use cases and what they would entail:
1831
1831
1832
1832
* A library developer needs to expose functionality to crates which link
1833
1833
against their library. As a consequence of the first case, this means that
@@ -1858,7 +1858,7 @@ import/expression is only valid if the destination is in the current visibility
1858
1858
scope.
1859
1859
1860
1860
Here's an example of a program which exemplifies the three cases outlined
1861
- above.
1861
+ above:
1862
1862
1863
1863
```
1864
1864
// This module is private, meaning that no external crate can access this
@@ -2213,7 +2213,7 @@ mod m1 {
2213
2213
```
2214
2214
2215
2215
This example shows how one can use ` allow ` and ` warn ` to toggle a particular
2216
- check on and off.
2216
+ check on and off:
2217
2217
2218
2218
``` {.ignore}
2219
2219
#[warn(missing_docs)]
@@ -2235,7 +2235,7 @@ mod m2{
2235
2235
```
2236
2236
2237
2237
This example shows how one can use ` forbid ` to disallow uses of ` allow ` for
2238
- that lint check.
2238
+ that lint check:
2239
2239
2240
2240
``` {.ignore}
2241
2241
#[forbid(missing_docs)]
@@ -2318,9 +2318,9 @@ These language items are traits:
2318
2318
* ` ord `
2319
2319
: Elements have a partial ordering.
2320
2320
* ` deref `
2321
- : ` * ` can be applied, yielding a reference to another type
2321
+ : ` * ` can be applied, yielding a reference to another type.
2322
2322
* ` deref_mut `
2323
- : ` * ` can be applied, yielding a mutable reference to another type
2323
+ : ` * ` can be applied, yielding a mutable reference to another type.
2324
2324
2325
2325
These are functions:
2326
2326
@@ -2341,7 +2341,7 @@ These are functions:
2341
2341
* ` type_id `
2342
2342
: The type returned by the ` type_id ` intrinsic.
2343
2343
* ` unsafe `
2344
- : A type whose contents can be mutated through an immutable reference
2344
+ : A type whose contents can be mutated through an immutable reference.
2345
2345
2346
2346
#### Marker types
2347
2347
@@ -2350,11 +2350,11 @@ These types help drive the compiler's analysis
2350
2350
* ` begin_unwind `
2351
2351
: ___ Needs filling in___
2352
2352
* ` no_copy_bound `
2353
- : This type does not implement "copy", even if eligible
2353
+ : This type does not implement "copy", even if eligible.
2354
2354
* ` no_send_bound `
2355
- : This type does not implement "send", even if eligible
2355
+ : This type does not implement "send", even if eligible.
2356
2356
* ` no_sync_bound `
2357
- : This type does not implement "sync", even if eligible
2357
+ : This type does not implement "sync", even if eligible.
2358
2358
* ` eh_personality `
2359
2359
: ___ Needs filling in___
2360
2360
* ` exchange_free `
@@ -2376,11 +2376,11 @@ These types help drive the compiler's analysis
2376
2376
* ` iterator `
2377
2377
: ___ Needs filling in___
2378
2378
* ` contravariant_lifetime `
2379
- : The lifetime parameter should be considered contravariant
2379
+ : The lifetime parameter should be considered contravariant.
2380
2380
* ` covariant_lifetime `
2381
- : The lifetime parameter should be considered covariant
2381
+ : The lifetime parameter should be considered covariant.
2382
2382
* ` invariant_lifetime `
2383
- : The lifetime parameter should be considered invariant
2383
+ : The lifetime parameter should be considered invariant.
2384
2384
* ` malloc `
2385
2385
: Allocate memory on the managed heap.
2386
2386
* ` owned_box `
@@ -2390,11 +2390,11 @@ These types help drive the compiler's analysis
2390
2390
* ` start `
2391
2391
: ___ Needs filling in___
2392
2392
* ` contravariant_type `
2393
- : The type parameter should be considered contravariant
2393
+ : The type parameter should be considered contravariant.
2394
2394
* ` covariant_type `
2395
- : The type parameter should be considered covariant
2395
+ : The type parameter should be considered covariant.
2396
2396
* ` invariant_type `
2397
- : The type parameter should be considered invariant
2397
+ : The type parameter should be considered invariant.
2398
2398
* ` ty_desc `
2399
2399
: ___ Needs filling in___
2400
2400
@@ -3219,11 +3219,11 @@ the simplest and least-expensive form (analogous to a ```|| { }``` expression),
3219
3219
the lambda expression captures its environment by reference, effectively
3220
3220
borrowing pointers to all outer variables mentioned inside the function.
3221
3221
Alternately, the compiler may infer that a lambda expression should copy or
3222
- move values (depending on their type. ) from the environment into the lambda
3222
+ move values (depending on their type) from the environment into the lambda
3223
3223
expression's captured environment.
3224
3224
3225
3225
In this example, we define a function ` ten_times ` that takes a higher-order
3226
- function argument, and call it with a lambda expression as an argument.
3226
+ function argument, and call it with a lambda expression as an argument:
3227
3227
3228
3228
```
3229
3229
fn ten_times<F>(f: F) where F: Fn(int) {
@@ -3661,14 +3661,14 @@ within an object along with one byte past the end.
3661
3661
The types ` char ` and ` str ` hold textual data.
3662
3662
3663
3663
A value of type ` char ` is a [ Unicode scalar value] (
3664
- http://www.unicode.org/glossary/#unicode_scalar_value ) (ie . a code point that
3664
+ http://www.unicode.org/glossary/#unicode_scalar_value ) (i.e . a code point that
3665
3665
is not a surrogate), represented as a 32-bit unsigned word in the 0x0000 to
3666
3666
0xD7FF or 0xE000 to 0x10FFFF range. A ` [char] ` array is effectively an UCS-4 /
3667
3667
UTF-32 string.
3668
3668
3669
3669
A value of type ` str ` is a Unicode string, represented as an array of 8-bit
3670
3670
unsigned bytes holding a sequence of UTF-8 codepoints. Since ` str ` is of
3671
- unknown size, it is not a _ first class_ type, but can only be instantiated
3671
+ unknown size, it is not a _ first- class_ type, but can only be instantiated
3672
3672
through a pointer type, such as ` &str ` or ` String ` .
3673
3673
3674
3674
### Tuple types
@@ -3698,7 +3698,7 @@ assert!(b != "world");
3698
3698
3699
3699
Rust has two different types for a list of items:
3700
3700
3701
- * ` [T .. N] ` , an 'array'
3701
+ * ` [T; N] ` , an 'array'.
3702
3702
* ` &[T] ` , a 'slice'.
3703
3703
3704
3704
An array has a fixed size, and can be allocated on either the stack or the
@@ -3710,9 +3710,9 @@ to, it borrows it.
3710
3710
An example of each kind:
3711
3711
3712
3712
``` {rust}
3713
- let vec: Vec<int> = vec![1, 2, 3];
3714
- let arr: [int ; 3] = [1, 2, 3];
3715
- let s: &[int] = vec.as_slice();
3713
+ let vec: Vec<i32> = vec![1, 2, 3];
3714
+ let arr: [i32 ; 3] = [1, 2, 3];
3715
+ let s: &[i32] = vec.as_slice();
3716
3716
```
3717
3717
3718
3718
As you can see, the ` vec! ` macro allows you to create a ` Vec<T> ` easily. The
@@ -3798,7 +3798,7 @@ enum List<T> {
3798
3798
Cons(T, Box<List<T>>)
3799
3799
}
3800
3800
3801
- let a: List<int > = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
3801
+ let a: List<i32 > = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
3802
3802
```
3803
3803
3804
3804
### Pointer types
0 commit comments