Skip to content

Commit 2422132

Browse files
committed
---
yaml --- r: 212848 b: refs/heads/master c: a279826 h: refs/heads/master v: v3
1 parent 78858a4 commit 2422132

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+23
-11721
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: 33b7386d3949e0a372e386f7a4593b12d5fa542a
2+
refs/heads/master: a27982623c12e759c0d8d8e53c5290b76351bdd3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/src/doc/trpl/patterns.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,27 @@ struct Point {
221221
let origin = Point { x: 0, y: 0 };
222222

223223
match origin {
224-
Point { x: x, y: y } => println!("({},{})", x, y),
224+
Point { x, y } => println!("({},{})", x, y),
225225
}
226226
```
227227

228228
[struct]: structs.html
229229

230+
We can use `:` to give a value a different name.
231+
232+
```rust
233+
struct Point {
234+
x: i32,
235+
y: i32,
236+
}
237+
238+
let origin = Point { x: 0, y: 0 };
239+
240+
match origin {
241+
Point { x: x1, y: y1 } => println!("({},{})", x1, y1),
242+
}
243+
```
244+
230245
If we only care about some of the values, we don’t have to give them all names:
231246

232247
```rust
@@ -238,7 +253,7 @@ struct Point {
238253
let origin = Point { x: 0, y: 0 };
239254

240255
match origin {
241-
Point { x: x, .. } => println!("x is {}", x),
256+
Point { x, .. } => println!("x is {}", x),
242257
}
243258
```
244259

@@ -255,7 +270,7 @@ struct Point {
255270
let origin = Point { x: 0, y: 0 };
256271

257272
match origin {
258-
Point { y: y, .. } => println!("y is {}", y),
273+
Point { y, .. } => println!("y is {}", y),
259274
}
260275
```
261276

trunk/src/doc/trpl/traits.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
% Traits
22

3+
A trait is a language feature that tells the Rust compiler about
4+
functionality a type must provide.
5+
36
Do you remember the `impl` keyword, used to call a function with [method
47
syntax][methodsyntax]?
58

trunk/src/liballoc/arc.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,6 @@ impl<T: ?Sized> Deref for Arc<T> {
330330
}
331331
}
332332

333-
#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
334-
impl<T: ?Sized> AsRef<T> for Arc<T> {
335-
336-
#[inline]
337-
fn as_ref(&self) -> &T {
338-
&self.inner().data
339-
}
340-
}
341-
342333
impl<T: Clone> Arc<T> {
343334
/// Make a mutable reference from the given `Arc<T>`.
344335
///

trunk/src/liballoc/rc.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ use std::boxed;
156156
use core::cell::Cell;
157157
use core::clone::Clone;
158158
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
159-
use core::convert::AsRef;
160159
use core::default::Default;
161160
use core::fmt;
162161
use core::hash::{Hasher, Hash};
@@ -380,15 +379,6 @@ impl<T: ?Sized> Deref for Rc<T> {
380379
}
381380
}
382381

383-
#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
384-
impl<T: ?Sized> AsRef<T> for Rc<T> {
385-
386-
#[inline(always)]
387-
fn as_ref(&self) -> &T {
388-
&self.inner().value
389-
}
390-
}
391-
392382
#[stable(feature = "rust1", since = "1.0.0")]
393383
impl<T: ?Sized> Drop for Rc<T> {
394384
/// Drops the `Rc<T>`.

trunk/src/test/compile-fail/dead-code-closure-bang.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
fn main() {
1616
let x = || panic!();
1717
x();
18-
std::io::println("Foo bar"); //~ ERROR: unreachable statement
18+
println!("Foo bar"); //~ ERROR: unreachable statement
1919
}

trunk/src/test/compile-fail/issue-15167.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
// except according to those terms.
1010

1111
// macro f should not be able to inject a reference to 'n'.
12-
//
13-
// Ignored because `for` loops are not hygienic yet; they will require special
14-
// handling since they introduce a new pattern binding position.
15-
16-
// ignore-test
1712

1813
macro_rules! f { () => (n) }
1914

trunk/src/test/compile-fail/issue-2478.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

trunk/src/test/compile-fail/redundant-link-args.rs

Lines changed: 0 additions & 29 deletions
This file was deleted.

trunk/src/test/compile-fail/struct-field-assignability.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

trunk/src/test/debuginfo/gdb-pretty-struct-and-enums.rs

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)