Skip to content

Commit b1d3ad3

Browse files
committed
---
yaml --- r: 195540 b: refs/heads/master c: 39aa668 h: refs/heads/master v: v3
1 parent f702279 commit b1d3ad3

File tree

290 files changed

+5441
-4173
lines changed

Some content is hidden

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

290 files changed

+5441
-4173
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: 02b38a2497c48c6195cdde4934ea08753f5b5539
2+
refs/heads/master: 39aa668a01fb671cff382a8237ec3993c9cc4c33
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b3317d68910900f135f9f38e43a7a699bc736b4a
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf

trunk/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![feature(std_misc)]
1919
#![feature(test)]
2020
#![feature(path_ext)]
21+
#![feature(convert)]
2122
#![feature(str_char)]
2223

2324
#![deny(warnings)]

trunk/src/doc/reference.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,13 +977,17 @@ An example of `use` declarations:
977977

978978
```
979979
# #![feature(core)]
980+
use std::iter::range_step;
980981
use std::option::Option::{Some, None};
981982
use std::collections::hash_map::{self, HashMap};
982983
983984
fn foo<T>(_: T){}
984985
fn bar(map1: HashMap<String, usize>, map2: hash_map::HashMap<String, usize>){}
985986
986987
fn main() {
988+
// Equivalent to 'std::iter::range_step(0, 10, 2);'
989+
range_step(0, 10, 2);
990+
987991
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
988992
// std::option::Option::None]);'
989993
foo(vec![Some(1.0f64), None]);

trunk/src/doc/trpl/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,5 @@
4242
* [Intrinsics](intrinsics.md)
4343
* [Lang items](lang-items.md)
4444
* [Link args](link-args.md)
45-
* [Benchmark Tests](benchmark-tests.md)
4645
* [Conclusion](conclusion.md)
4746
* [Glossary](glossary.md)

trunk/src/doc/trpl/benchmark-tests.md

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

trunk/src/doc/trpl/concurrency.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,13 @@ it returns an `Result<T, E>`, and because this is just an example, we `unwrap()`
280280
it to get a reference to the data. Real code would have more robust error handling
281281
here. We're then free to mutate it, since we have the lock.
282282

283-
Lastly, while the threads are running, we wait on a short timer. But
284-
this is not ideal: we may have picked a reasonable amount of time to
285-
wait but it's more likely we'll either be waiting longer than
286-
necessary or not long enough, depending on just how much time the
287-
threads actually take to finish computing when the program runs.
288-
289-
A more precise alternative to the timer would be to use one of the
290-
mechanisms provided by the Rust standard library for synchronizing
291-
threads with each other. Let's talk about one of them: channels.
283+
This timer bit is a bit awkward, however. We have picked a reasonable amount of
284+
time to wait, but it's entirely possible that we've picked too high, and that
285+
we could be taking less time. It's also possible that we've picked too low,
286+
and that we aren't actually finishing this computation.
287+
288+
Rust's standard library provides a few more mechanisms for two threads to
289+
synchronize with each other. Let's talk about one: channels.
292290

293291
## Channels
294292

trunk/src/doc/trpl/iterators.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,11 @@ for num in nums.iter() {
243243
```
244244

245245
These two basic iterators should serve you well. There are some more
246-
advanced iterators, including ones that are infinite. Like using range syntax
247-
and `step_by`:
246+
advanced iterators, including ones that are infinite. Like `count`:
248247

249248
```rust
250-
# #![feature(step_by)]
251-
(1..).step_by(5);
249+
# #![feature(core)]
250+
std::iter::count(1, 5);
252251
```
253252

254253
This iterator counts up from one, adding five each time. It will give
@@ -293,11 +292,11 @@ just use `for` instead.
293292
There are tons of interesting iterator adapters. `take(n)` will return an
294293
iterator over the next `n` elements of the original iterator, note that this
295294
has no side effect on the original iterator. Let's try it out with our infinite
296-
iterator from before:
295+
iterator from before, `count()`:
297296

298297
```rust
299-
# #![feature(step_by)]
300-
for i in (1..).step_by(5).take(5) {
298+
# #![feature(core)]
299+
for i in std::iter::count(1, 5).take(5) {
301300
println!("{}", i);
302301
}
303302
```

trunk/src/doc/trpl/macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ number of elements.
3737

3838
```rust
3939
let x: Vec<u32> = vec![1, 2, 3];
40-
# assert_eq!(x, [1, 2, 3]);
40+
# assert_eq!(&[1,2,3], &x);
4141
```
4242

4343
This can't be an ordinary function, because it takes any number of arguments.
@@ -51,7 +51,7 @@ let x: Vec<u32> = {
5151
temp_vec.push(3);
5252
temp_vec
5353
};
54-
# assert_eq!(x, [1, 2, 3]);
54+
# assert_eq!(&[1,2,3], &x);
5555
```
5656

5757
We can implement this shorthand, using a macro: [^actual]
@@ -73,7 +73,7 @@ macro_rules! vec {
7373
};
7474
}
7575
# fn main() {
76-
# assert_eq!(vec![1,2,3], [1, 2, 3]);
76+
# assert_eq!([1,2,3], vec![1,2,3]);
7777
# }
7878
```
7979

trunk/src/doc/trpl/ownership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ forbidden in item signatures to allow reasoning about the types just based in
477477
the item signature alone. However, for ergonomic reasons a very restricted
478478
secondary inference algorithm called “lifetime elision” applies in function
479479
signatures. It infers only based on the signature components themselves and not
480-
based on the body of the function, only infers lifetime parameters, and does
480+
based on the body of the function, only infers lifetime paramters, and does
481481
this with only three easily memorizable and unambiguous rules. This makes
482482
lifetime elision a shorthand for writing an item signature, while not hiding
483483
away the actual types involved as full local inference would if applied to it.

0 commit comments

Comments
 (0)