Skip to content

Commit 7b1fb39

Browse files
committed
---
yaml --- r: 157245 b: refs/heads/master c: 221fc1e h: refs/heads/master i: 157243: 699d502 v: v3
1 parent 326c211 commit 7b1fb39

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6fcba8826fd26028341a35d88b07208378ac05ea
2+
refs/heads/master: 221fc1e3cdcc208e1bb7debcc2de27d47c847747
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d44ea720fa9dfe062ef06d0eb49a58d4e7e92344
55
refs/heads/try: 6ecdf1fa83d7cdbf44a0091132e9c6580be72275

trunk/src/doc/guide.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3527,8 +3527,8 @@ everyone plays by these rules. At compile time, it verifies that none of these
35273527
rules are broken. If our program compiles successfully, Rust can guarantee it
35283528
is free of data races and other memory errors, and there is no runtime overhead
35293529
for any of this. The borrow checker works only at compile time. If the borrow
3530-
checker did find a problem, it will report a **lifetime error**, and your
3531-
program will refuse to compile.
3530+
checker did find a problem, it will report an error and your program will
3531+
refuse to compile.
35323532

35333533
That's a lot to take in. It's also one of the _most_ important concepts in
35343534
all of Rust. Let's see this syntax in action:
@@ -3852,7 +3852,7 @@ the value to a name with `@`:
38523852
let x = 1i;
38533853
38543854
match x {
3855-
x @ 1 ... 5 => println!("got {}", x),
3855+
e @ 1 ... 5 => println!("got a range element {}", e),
38563856
_ => println!("anything"),
38573857
}
38583858
```
@@ -3885,7 +3885,7 @@ enum OptionalInt {
38853885
let x = Value(5i);
38863886
38873887
match x {
3888-
Value(x) if x > 5 => println!("Got an int bigger than five!"),
3888+
Value(i) if i > 5 => println!("Got an int bigger than five!"),
38893889
Value(..) => println!("Got an int!"),
38903890
Missing => println!("No such luck."),
38913891
}
@@ -3898,12 +3898,12 @@ with. First, `&`:
38983898
let x = &5i;
38993899
39003900
match x {
3901-
&x => println!("Got a value: {}", x),
3901+
&val => println!("Got a value: {}", val),
39023902
}
39033903
```
39043904

3905-
Here, the `x` inside the `match` has type `int`. In other words, the left hand
3906-
side of the pattern destructures the value. If we have `&5i`, then in `&x`, `x`
3905+
Here, the `val` inside the `match` has type `int`. In other words, the left hand
3906+
side of the pattern destructures the value. If we have `&5i`, then in `&val`, `val`
39073907
would be `5i`.
39083908

39093909
If you want to get a reference, use the `ref` keyword:
@@ -3912,19 +3912,19 @@ If you want to get a reference, use the `ref` keyword:
39123912
let x = 5i;
39133913
39143914
match x {
3915-
ref x => println!("Got a reference to {}", x),
3915+
ref r => println!("Got a reference to {}", r),
39163916
}
39173917
```
39183918

3919-
Here, the `x` inside the `match` has the type `&int`. In other words, the `ref`
3919+
Here, the `r` inside the `match` has the type `&int`. In other words, the `ref`
39203920
keyword _creates_ a reference, for use in the pattern. If you need a mutable
39213921
reference, `ref mut` will work in the same way:
39223922

39233923
```{rust}
39243924
let mut x = 5i;
39253925
39263926
match x {
3927-
ref mut x => println!("Got a mutable reference to {}", x),
3927+
ref mut mr => println!("Got a mutable reference to {}", mr),
39283928
}
39293929
```
39303930

trunk/src/doc/reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,6 +2017,7 @@ On `struct`s:
20172017
- `unsafe_no_drop_flag` - on structs, remove the flag that prevents
20182018
destructors from being run twice. Destructors might be run multiple times on
20192019
the same object with this attribute.
2020+
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
20202021

20212022
### Conditional compilation
20222023

0 commit comments

Comments
 (0)