Skip to content

Commit 94c8781

Browse files
committed
---
yaml --- r: 157686 b: refs/heads/snap-stage3 c: 221fc1e h: refs/heads/master v: v3
1 parent 511bdb7 commit 94c8781

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,7 +1,7 @@
11
---
22
refs/heads/master: 065caf34f5ff29e04605f95d9c5d511af219439a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 6fcba8826fd26028341a35d88b07208378ac05ea
4+
refs/heads/snap-stage3: 221fc1e3cdcc208e1bb7debcc2de27d47c847747
55
refs/heads/try: 0ee4d8b0b112c608646fa75463ab4dc59132efd9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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

branches/snap-stage3/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)