Skip to content

Commit 352fd52

Browse files
committed
---
yaml --- r: 207959 b: refs/heads/snap-stage3 c: 3eee2b9 h: refs/heads/master i: 207957: 05318a0 207955: 87f565c 207951: 7241d34 v: v3
1 parent 96bb952 commit 352fd52

File tree

29 files changed

+129
-447
lines changed

29 files changed

+129
-447
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: 38a97becdf3e6a6157f6f7ec2d98ade8d8edc193
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1ea9e8db6f9a2da62dcdc4ff7cdbcf7ded4e56b5
4+
refs/heads/snap-stage3: 3eee2b93192af0d74c9a02a195dea7afe2781838
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
269269
run_ignored: config.run_ignored,
270270
logfile: config.logfile.clone(),
271271
run_tests: true,
272-
bench_benchmarks: true,
272+
run_benchmarks: true,
273273
nocapture: env::var("RUST_TEST_NOCAPTURE").is_ok(),
274274
color: test::AutoColor,
275275
}

branches/snap-stage3/src/doc/trpl/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ want to dive in with a project, or ‘Syntax and Semantics’ if you prefer to
4040
start small, and learn a single concept thoroughly before moving onto the next.
4141
Copious cross-linking connects these parts together.
4242

43+
### Contributing
44+
45+
The source files from which this book is generated can be found on Github:
46+
[github.com/rust-lang/rust/tree/master/src/doc/trpl](https://github.com/rust-lang/rust/tree/master/src/doc/trpl)
47+
4348
## A brief introduction to Rust
4449

4550
Is Rust a language you might be interested in? Let’s examine a few small code

branches/snap-stage3/src/doc/trpl/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,5 @@
6464
* [Benchmark Tests](benchmark-tests.md)
6565
* [Box Syntax and Patterns](box-syntax-and-patterns.md)
6666
* [Slice Patterns](slice-patterns.md)
67-
* [Associated Constants](associated-constants.md)
6867
* [Glossary](glossary.md)
6968
* [Academic Research](academic-research.md)

branches/snap-stage3/src/doc/trpl/associated-constants.md

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

branches/snap-stage3/src/doc/trpl/concurrency.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ use std::thread;
116116
fn main() {
117117
let mut data = vec![1u32, 2, 3];
118118
119-
for i in 0..3 {
119+
for i in 0..2 {
120120
thread::spawn(move || {
121121
data[i] += 1;
122122
});
@@ -154,7 +154,7 @@ use std::sync::Mutex;
154154
fn main() {
155155
let mut data = Mutex::new(vec![1u32, 2, 3]);
156156
157-
for i in 0..3 {
157+
for i in 0..2 {
158158
let data = data.lock().unwrap();
159159
thread::spawn(move || {
160160
data[i] += 1;
@@ -196,7 +196,7 @@ use std::thread;
196196
fn main() {
197197
let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
198198
199-
for i in 0..3 {
199+
for i in 0..2 {
200200
let data = data.clone();
201201
thread::spawn(move || {
202202
let mut data = data.lock().unwrap();
@@ -217,7 +217,7 @@ thread more closely:
217217
# use std::thread;
218218
# fn main() {
219219
# let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
220-
# for i in 0..3 {
220+
# for i in 0..2 {
221221
# let data = data.clone();
222222
thread::spawn(move || {
223223
let mut data = data.lock().unwrap();

branches/snap-stage3/src/doc/trpl/patterns.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ This prints `something else`
7070

7171
# Bindings
7272

73-
You can bind values to names with `@`:
73+
If you’re matching multiple things, via a `|` or a `...`, you can bind
74+
the value to a name with `@`:
7475

7576
```rust
7677
let x = 1;
@@ -81,36 +82,7 @@ match x {
8182
}
8283
```
8384

84-
This prints `got a range element 1`. This is useful when you want to
85-
do a complicated match of part of a data structure:
86-
87-
```rust
88-
#[derive(Debug)]
89-
struct Person {
90-
name: Option<String>,
91-
}
92-
93-
let name = "Steve".to_string();
94-
let mut x: Option<Person> = Some(Person { name: Some(name) });
95-
match x {
96-
Some(Person { name: ref a @ Some(_), .. }) => println!("{:?}", a),
97-
_ => {}
98-
}
99-
```
100-
101-
This prints `Some("Steve")`: We’ve bound the inner `name` to `a`.
102-
103-
If you use `@` with `|`, you need to make sure the name is bound in each part
104-
of the pattern:
105-
106-
```rust
107-
let x = 5;
108-
109-
match x {
110-
e @ 1 ... 5 | e @ 8 ... 10 => println!("got a range element {}", e),
111-
_ => println!("anything"),
112-
}
113-
```
85+
This prints `got a range element 1`.
11486

11587
# Ignoring variants
11688

branches/snap-stage3/src/libcollections/slice.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,11 @@ pub trait SliceConcatExt<T: ?Sized, U> {
10041004
/// # Examples
10051005
///
10061006
/// ```
1007-
/// assert_eq!(["hello", "world"].concat(), "helloworld");
1007+
/// let v = vec!["hello", "world"];
1008+
///
1009+
/// let s: String = v.concat();
1010+
///
1011+
/// println!("{}", s); // prints "helloworld"
10081012
/// ```
10091013
#[stable(feature = "rust1", since = "1.0.0")]
10101014
fn concat(&self) -> U;
@@ -1014,7 +1018,11 @@ pub trait SliceConcatExt<T: ?Sized, U> {
10141018
/// # Examples
10151019
///
10161020
/// ```
1017-
/// assert_eq!(["hello", "world"].connect(" "), "hello world");
1021+
/// let v = vec!["hello", "world"];
1022+
///
1023+
/// let s: String = v.connect(" ");
1024+
///
1025+
/// println!("{}", s); // prints "hello world"
10181026
/// ```
10191027
#[stable(feature = "rust1", since = "1.0.0")]
10201028
fn connect(&self, sep: &T) -> U;

branches/snap-stage3/src/libcollections/vec.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,11 +1777,6 @@ impl<T> Iterator for IntoIter<T> {
17771777
let exact = diff / (if size == 0 {1} else {size});
17781778
(exact, Some(exact))
17791779
}
1780-
1781-
#[inline]
1782-
fn count(self) -> usize {
1783-
self.size_hint().0
1784-
}
17851780
}
17861781

17871782
#[stable(feature = "rust1", since = "1.0.0")]

branches/snap-stage3/src/libcollectionstest/vec.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,6 @@ fn test_split_off() {
542542
assert_eq!(vec2, [5, 6]);
543543
}
544544

545-
#[test]
546-
fn test_into_iter_count() {
547-
assert_eq!(vec![1, 2, 3].into_iter().count(), 3);
548-
}
549-
550545
#[bench]
551546
fn bench_new(b: &mut Bencher) {
552547
b.iter(|| {

0 commit comments

Comments
 (0)