Skip to content

Commit 84b1e08

Browse files
committed
Auto merge of #25560 - Manishearth:rollup, r=Manishearth
- Successful merges: #25526, #25530, #25537 - Failed merges:
2 parents 8a8583c + 5ed02b5 commit 84b1e08

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/doc/trpl/closures.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ The second is that the syntax is similar, but a bit different. I’ve added spac
5454
here to make them look a little closer:
5555

5656
```rust
57-
fn plus_one_v1 (x: i32 ) -> i32 { x + 1 }
58-
let plus_one_v2 = |x: i32 | -> i32 { x + 1 };
59-
let plus_one_v3 = |x: i32 | x + 1 ;
57+
fn plus_one_v1 (x: i32) -> i32 { x + 1 }
58+
let plus_one_v2 = |x: i32| -> i32 { x + 1 };
59+
let plus_one_v3 = |x: i32| x + 1 ;
6060
```
6161

6262
Small differences, but they’re similar in ways.
@@ -136,7 +136,7 @@ This gives us:
136136
note: `nums` moved into closure environment here because it has type
137137
`[closure(()) -> collections::vec::Vec<i32>]`, which is non-copyable
138138
let takes_nums = || nums;
139-
^~~~~~~
139+
^~~~~~~
140140
```
141141

142142
`Vec<T>` has ownership over its contents, and therefore, when we refer to it
@@ -352,8 +352,8 @@ error: the trait `core::marker::Sized` is not implemented for the type
352352
factory() -> (Fn(i32) -> Vec<i32>) {
353353
^~~~~~~~~~~~~~~~~~~~~
354354
note: `core::ops::Fn(i32) -> collections::vec::Vec<i32>` does not have a constant size known at compile-time
355-
fa ctory() -> (Fn(i32) -> Vec<i32>) {
356-
^~~~~~~~~~~~~~~~~~~~~
355+
factory() -> (Fn(i32) -> Vec<i32>) {
356+
^~~~~~~~~~~~~~~~~~~~~
357357
358358
```
359359

src/doc/trpl/references-and-borrowing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ We can’t modify `v` because it’s borrowed by the loop.
297297
References must live as long as the resource they refer to. Rust will check the
298298
scopes of your references to ensure that this is true.
299299

300-
If Rust didn’t check that this property, we could accidentally use a reference
300+
If Rust didn’t check this property, we could accidentally use a reference
301301
which was invalid. For example:
302302

303303
```rust,ignore

src/grammar/verify.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
111111
"LIT_BINARY_RAW" => token::Literal(token::BinaryRaw(Name(0), 0), None),
112112
"QUESTION" => token::Question,
113113
"SHEBANG" => token::Shebang(Name(0)),
114-
_ => panic!("Bad token str `{}`", val),
114+
_ => continue,
115115
};
116116

117117
res.insert(num.to_string(), tok);

0 commit comments

Comments
 (0)