Skip to content

Commit 0d8309e

Browse files
committed
Auto merge of #24813 - Manishearth:rollup, r=Manishearth
- Successful merges: #24649, #24806, #24809, #24811 - Manual merges: #24812
2 parents 83263b4 + 3e67b6b commit 0d8309e

12 files changed

+34
-24
lines changed

src/doc/reference.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ explicit code point lists. [^inputformat]
6868
## Special Unicode Productions
6969

7070
The following productions in the Rust grammar are defined in terms of Unicode
71-
properties: `ident`, `non_null`, `non_star`, `non_eol`, `non_slash_or_star`,
72-
`non_single_quote` and `non_double_quote`.
71+
properties: `ident`, `non_null`, `non_eol`, `non_single_quote` and `non_double_quote`.
7372

7473
### Identifiers
7574

76-
The `ident` production is any nonempty Unicode string of the following form:
75+
The `ident` production is any nonempty Unicode[^non_ascii_idents] string of the following form:
76+
77+
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
78+
gated. This is expected to improve soon.
7779

7880
- The first character has property `XID_start`
7981
- The remaining characters have property `XID_continue`
@@ -90,8 +92,6 @@ Some productions are defined by exclusion of particular Unicode characters:
9092

9193
- `non_null` is any single Unicode character aside from `U+0000` (null)
9294
- `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`)
93-
- `non_star` is `non_null` restricted to exclude `U+002A` (`*`)
94-
- `non_slash_or_star` is `non_null` restricted to exclude `U+002F` (`/`) and `U+002A` (`*`)
9595
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
9696
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
9797

@@ -1977,7 +1977,7 @@ For any lint check `C`:
19771977

19781978
The lint checks supported by the compiler can be found via `rustc -W help`,
19791979
along with their default settings. [Compiler
1980-
plugins](book/plugins.html#lint-plugins) can provide additional lint checks.
1980+
plugins](book/compiler-plugins.html#lint-plugins) can provide additional lint checks.
19811981

19821982
```{.ignore}
19831983
mod m1 {
@@ -3647,4 +3647,4 @@ that have since been removed):
36473647
pattern syntax
36483648

36493649
[ffi]: book/ffi.html
3650-
[plugin]: book/plugins.html
3650+
[plugin]: book/compiler-plugins.html

src/doc/trpl/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ good at: embedding in other languages, programs with specific space and time
88
requirements, and writing low-level code, like device drivers and operating
99
systems. It improves on current languages targeting this space by having a
1010
number of compile-time safety checks that produce no runtime overhead, while
11-
eliminating all data races. Rust also aims to achieve ‘zero-cost abstrations
11+
eliminating all data races. Rust also aims to achieve ‘zero-cost abstractions
1212
even though some of these abstractions feel like those of a high-level
1313
language. Even then, Rust still allows precise control like a low-level
1414
language would.

src/doc/trpl/closures.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ is `Fn(i32) -> i32`.
294294

295295
There’s one other key point here: because we’re bounding a generic with a
296296
trait, this will get monomorphized, and therefore, we’ll be doing static
297-
dispatch into the closure. That’s pretty neat. In many langauges, closures are
297+
dispatch into the closure. That’s pretty neat. In many languages, closures are
298298
inherently heap allocated, and will always involve dynamic dispatch. In Rust,
299299
we can stack allocate our closure environment, and statically dispatch the
300300
call. This happens quite often with iterators and their adapters, which often

src/doc/trpl/documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ This sets a few different options, with a logo, favicon, and a root URL.
556556

557557
## Generation options
558558

559-
`rustdoc` also contains a few other options on the command line, for further customiziation:
559+
`rustdoc` also contains a few other options on the command line, for further customization:
560560

561561
- `--html-in-header FILE`: includes the contents of FILE at the end of the
562562
`<head>...</head>` section.

src/doc/trpl/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Getting Started
22

33
This first section of the book will get you going with Rust and its tooling.
4-
First, we’ll install Rust. Then: the classic ‘Hello World’ program. Finally,
4+
First, we’ll install Rust. Then, the classic ‘Hello World’ program. Finally,
55
we’ll talk about Cargo, Rust’s build system and package manager.

src/doc/trpl/glossary.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In the example above `x` and `y` have arity 2. `z` has arity 3.
1919

2020
When a compiler is compiling your program, it does a number of different
2121
things. One of the things that it does is turn the text of your program into an
22-
'abstract syntax tree,' or 'AST.' This tree is a representation of the
22+
abstract syntax tree’, orAST’. This tree is a representation of the
2323
structure of your program. For example, `2 + 3` can be turned into a tree:
2424

2525
```text

src/doc/trpl/mutability.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ about it first.
129129

130130
## Field-level mutability
131131

132-
Mutabilty is a property of either a borrow (`&mut`) or a binding (`let mut`).
132+
Mutability is a property of either a borrow (`&mut`) or a binding (`let mut`).
133133
This means that, for example, you cannot have a [`struct`][struct] with
134134
some fields mutable and some immutable:
135135

src/doc/trpl/primitive-types.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ let y = 1.0; // y has type f64
6262
Here’s a list of the different numeric types, with links to their documentation
6363
in the standard library:
6464

65+
* [i8](../std/primitive.i8.html)
6566
* [i16](../std/primitive.i16.html)
6667
* [i32](../std/primitive.i32.html)
6768
* [i64](../std/primitive.i64.html)
68-
* [i8](../std/primitive.i8.html)
69+
* [u8](../std/primitive.u8.html)
6970
* [u16](../std/primitive.u16.html)
7071
* [u32](../std/primitive.u32.html)
7172
* [u64](../std/primitive.u64.html)
72-
* [u8](../std/primitive.u8.html)
7373
* [isize](../std/primitive.isize.html)
7474
* [usize](../std/primitive.usize.html)
7575
* [f32](../std/primitive.f32.html)
@@ -82,12 +82,12 @@ Let’s go over them by category:
8282
Integer types come in two varieties: signed and unsigned. To understand the
8383
difference, let’s consider a number with four bits of size. A signed, four-bit
8484
number would let you store numbers from `-8` to `+7`. Signed numbers use
85-
two’s compliment representation. An unsigned four bit number, since it does
85+
two’s compliment representation. An unsigned four bit number, since it does
8686
not need to store negatives, can store values from `0` to `+15`.
8787

8888
Unsigned types use a `u` for their category, and signed types use `i`. The `i`
8989
is for ‘integer’. So `u8` is an eight-bit unsigned number, and `i8` is an
90-
eight-bit signed number.
90+
eight-bit signed number.
9191

9292
## Fixed size types
9393

@@ -103,7 +103,7 @@ and unsigned varieties. This makes for two types: `isize` and `usize`.
103103

104104
## Floating-point types
105105

106-
Rust also two floating point types: `f32` and `f64`. These correspond to
106+
Rust also has two floating point types: `f32` and `f64`. These correspond to
107107
IEEE-754 single and double precision numbers.
108108

109109
# Arrays
@@ -241,8 +241,8 @@ println!("x is {}", x);
241241
Remember [before][let] when I said the left-hand side of a `let` statement was more
242242
powerful than just assigning a binding? Here we are. We can put a pattern on
243243
the left-hand side of the `let`, and if it matches up to the right-hand side,
244-
we can assign multiple bindings at once. In this case, `let` "destructures,"
245-
or "breaks up," the tuple, and assigns the bits to three bindings.
244+
we can assign multiple bindings at once. In this case, `let` destructures
245+
or breaks up the tuple, and assigns the bits to three bindings.
246246

247247
[let]: variable-bindings.html
248248

src/doc/trpl/trait-objects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ A function that takes a trait object is not specialized to each of the types
155155
that implements `Foo`: only one copy is generated, often (but not always)
156156
resulting in less code bloat. However, this comes at the cost of requiring
157157
slower virtual function calls, and effectively inhibiting any chance of
158-
inlining and related optimisations from occurring.
158+
inlining and related optimizations from occurring.
159159

160160
### Why pointers?
161161

src/doc/trpl/traits.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ won’t have its methods:
184184
```rust,ignore
185185
let mut f = std::fs::File::open("foo.txt").ok().expect("Couldn’t open foo.txt");
186186
let result = f.write("whatever".as_bytes());
187-
# result.unwrap(); // ignore the erorr
187+
# result.unwrap(); // ignore the error
188188
```
189189

190190
Here’s the error:
@@ -203,7 +203,7 @@ use std::io::Write;
203203
204204
let mut f = std::fs::File::open("foo.txt").ok().expect("Couldn’t open foo.txt");
205205
let result = f.write("whatever".as_bytes());
206-
# result.unwrap(); // ignore the erorr
206+
# result.unwrap(); // ignore the error
207207
```
208208

209209
This will compile without error.

src/doc/trpl/variable-bindings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Variable Bindings
22

3-
Vitually every non-Hello World’ Rust program uses *variable bindings*. They
3+
Virtually every non-'Hello World’ Rust program uses *variable bindings*. They
44
look like this:
55

66
```rust

src/libstd/path.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,16 @@ impl Path {
12411241
///
12421242
/// Path::new("foo.txt");
12431243
/// ```
1244+
///
1245+
/// You can create `Path`s from `String`s, or even other `Path`s:
1246+
///
1247+
/// ```
1248+
/// use std::path::Path;
1249+
///
1250+
/// let s = String::from("bar.txt");
1251+
/// let p = Path::new(&s);
1252+
/// Path::new(&p);
1253+
/// ```
12441254
#[stable(feature = "rust1", since = "1.0.0")]
12451255
pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &Path {
12461256
unsafe { mem::transmute(s.as_ref()) }

0 commit comments

Comments
 (0)