Skip to content

Commit c7a7db4

Browse files
committed
---
yaml --- r: 210834 b: refs/heads/try c: 7ebaf1c h: refs/heads/master v: v3
1 parent 6b4d0b8 commit c7a7db4

Some content is hidden

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

58 files changed

+2499
-2217
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 02603334ae22971409c11e547a3568d70b9c60ac
5+
refs/heads/try: 7ebaf1c5c6dcff22d554bc0169a7416f1305c8c4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/reference.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3529,7 +3529,9 @@ The actual implementation for each vtable entry can vary on an object-by-object
35293529
basis.
35303530

35313531
Note that for a trait object to be instantiated, the trait must be
3532-
_object-safe_. Object safety rules are defined in [RFC 255][rfc255].
3532+
_object-safe_. Object safety rules are defined in [RFC 255].
3533+
3534+
[RFC 255]: https://github.com/rust-lang/rfcs/blob/master/text/0255-object-safety.md
35333535

35343536
Given a pointer-typed expression `E` of type `&T` or `Box<T>`, where `T`
35353537
implements trait `R`, casting `E` to the corresponding pointer type `&R` or

branches/try/src/doc/trpl/concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ and more cores, yet many programmers aren't prepared to fully utilize them.
66

77
Rust's memory safety features also apply to its concurrency story too. Even
88
concurrent Rust programs must be memory safe, having no data races. Rust's type
9-
system is up to the thread, and gives you powerful ways to reason about
9+
system is up to the task, and gives you powerful ways to reason about
1010
concurrent code at compile time.
1111

1212
Before we talk about the concurrency features that come with Rust, it's important

branches/try/src/doc/trpl/dining-philosophers.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ a name is all we need. We choose the [`String`][string] type for the name,
7373
rather than `&str`. Generally speaking, working with a type which owns its
7474
data is easier than working with one that uses references.
7575

76+
[struct]: structs.html
77+
[string]: strings.html
78+
7679
Let’s continue:
7780

7881
```rust

branches/try/src/doc/trpl/enums.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ fn process_color_change(msg: Message) {
5555
}
5656
```
5757

58-
Both variants are named `Digit`, but since they’re scoped to the `enum` name
59-
there's no ambiguity.
60-
6158
Not supporting these operations may seem rather limiting, but it’s a limitation
6259
which we can overcome. There are two ways: by implementing equality ourselves,
6360
or by pattern matching variants with [`match`][match] expressions, which you’ll
@@ -66,3 +63,4 @@ equality yet, but we’ll find out in the [`traits`][traits] section.
6663

6764
[match]: match.html
6865
[if-let]: if-let.html
66+
[traits]: traits.html

branches/try/src/doc/trpl/guessing-game.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ The next part will use this handle to get input from the user:
213213
```
214214

215215
Here, we call the [`read_line()`][read_line] method on our handle.
216-
[Method][method]s are like associated functions, but are only available on a
216+
[Methods][method] are like associated functions, but are only available on a
217217
particular instance of a type, rather than the type itself. We’re also passing
218218
one argument to `read_line()`: `&mut guess`.
219219

220220
[read_line]: ../std/io/struct.Stdin.html#method.read_line
221-
[method]: methods.html
221+
[method]: method-syntax.html
222222

223223
Remember how we bound `guess` above? We said it was mutable. However,
224224
`read_line` doesn’t take a `String` as an argument: it takes a `&mut String`.

branches/try/src/doc/trpl/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ loop is just a handy way to write this `loop`/`match`/`break` construct.
4242
`for` loops aren't the only thing that uses iterators, however. Writing your
4343
own iterator involves implementing the `Iterator` trait. While doing that is
4444
outside of the scope of this guide, Rust provides a number of useful iterators
45-
to accomplish various threads. Before we talk about those, we should talk about a
45+
to accomplish various tasks. Before we talk about those, we should talk about a
4646
Rust anti-pattern. And that's using ranges like this.
4747

4848
Yes, we just talked about how ranges are cool. But ranges are also very

branches/try/src/doc/trpl/match.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ Unlike the previous uses of `match`, you can’t use the normal `if`
9797
statement to do this. You can use the [`if let`][if-let] statement,
9898
which can be seen as an abbreviated form of `match`.
9999

100-
[if-let][if-let.html]
100+
[if-let]: if-let.html

branches/try/src/doc/trpl/mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let y = &mut x;
3535

3636
`y` is an immutable binding to a mutable reference, which means that you can’t
3737
bind `y` to something else (`y = &mut z`), but you can mutate the thing that’s
38-
bound to `y`. (`*y = 5`) A subtle distinction.
38+
bound to `y` (`*y = 5`). A subtle distinction.
3939

4040
Of course, if you need both:
4141

branches/try/src/doc/trpl/patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ match x {
6666
}
6767
```
6868

69-
This prints `something else`
69+
This prints `something else`.
7070

7171
# Bindings
7272

@@ -152,7 +152,7 @@ match x {
152152
}
153153
```
154154

155-
This prints `Got an int!`
155+
This prints `Got an int!`.
156156

157157
# ref and ref mut
158158

branches/try/src/doc/trpl/structs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,5 @@ useful. For instance, a library may ask you to create a structure that
196196
implements a certain [trait][trait] to handle events. If you don’t have
197197
any data you need to store in the structure, you can just create a
198198
unit-like struct.
199+
200+
[trait]: traits.html

branches/try/src/doc/trpl/the-stack-and-the-heap.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ This memory is kind of like a giant array: addresses start at zero and go
8080
up to the final number. So here’s a diagram of our first stack frame:
8181

8282
| Address | Name | Value |
83-
+---------+------+-------+
83+
|---------|------|-------|
8484
| 0 | x | 42 |
8585

8686
We’ve got `x` located at address `0`, with the value `42`.
8787

8888
When `foo()` is called, a new stack frame is allocated:
8989

9090
| Address | Name | Value |
91-
+---------+------+-------+
91+
|---------|------|-------|
9292
| 2 | z | 100 |
9393
| 1 | y | 5 |
9494
| 0 | x | 42 |
@@ -107,7 +107,7 @@ value being stored.
107107
After `foo()` is over, its frame is deallocated:
108108

109109
| Address | Name | Value |
110-
+---------+------+-------+
110+
|---------|------|-------|
111111
| 0 | x | 42 |
112112

113113
And then, after `main()`, even this last value goes away. Easy!
@@ -142,13 +142,13 @@ fn main() {
142142
Okay, first, we call `main()`:
143143

144144
| Address | Name | Value |
145-
+---------+------+-------+
145+
|---------|------|-------|
146146
| 0 | x | 42 |
147147

148148
Next up, `main()` calls `foo()`:
149149

150150
| Address | Name | Value |
151-
+---------+------+-------+
151+
|---------|------|-------|
152152
| 3 | c | 1 |
153153
| 2 | b | 100 |
154154
| 1 | a | 5 |
@@ -157,7 +157,7 @@ Next up, `main()` calls `foo()`:
157157
And then `foo()` calls `bar()`:
158158

159159
| Address | Name | Value |
160-
+---------+------+-------+
160+
|---------|------|-------|
161161
| 4 | i | 6 |
162162
| 3 | c | 1 |
163163
| 2 | b | 100 |
@@ -170,7 +170,7 @@ After `bar()` is over, its frame is deallocated, leaving just `foo()` and
170170
`main()`:
171171

172172
| Address | Name | Value |
173-
+---------+------+-------+
173+
|---------|------|-------|
174174
| 3 | c | 1 |
175175
| 2 | b | 100 |
176176
| 1 | a | 5 |
@@ -179,7 +179,7 @@ After `bar()` is over, its frame is deallocated, leaving just `foo()` and
179179
And then `foo()` ends, leaving just `main()`
180180

181181
| Address | Name | Value |
182-
+---------+------+-------+
182+
|---------|------|-------|
183183
| 0 | x | 42 |
184184

185185
And then we’re done. Getting the hang of it? It’s like piling up dishes: you
@@ -206,7 +206,7 @@ fn main() {
206206
Here’s what happens in memory when `main()` is called:
207207

208208
| Address | Name | Value |
209-
+---------+------+--------+
209+
|---------|------|--------|
210210
| 1 | y | 42 |
211211
| 0 | x | ?????? |
212212

@@ -218,7 +218,7 @@ it allocates some memory for the heap, and puts `5` there. The memory now looks
218218
like this:
219219

220220
| Address | Name | Value |
221-
+-----------------+------+----------------+
221+
|-----------------|------|----------------|
222222
| 2<sup>30</sup> | | 5 |
223223
| ... | ... | ... |
224224
| 1 | y | 42 |
@@ -243,7 +243,7 @@ layout of a program which has been running for a while now:
243243

244244

245245
| Address | Name | Value |
246-
+----------------------+------+----------------------+
246+
|----------------------|------|----------------------|
247247
| 2<sup>30</sup> | | 5 |
248248
| (2<sup>30</sup>) - 1 | | |
249249
| (2<sup>30</sup>) - 2 | | |
@@ -272,7 +272,7 @@ when it was created. Great! So when `x` goes away, it first frees the memory
272272
allocated on the heap:
273273

274274
| Address | Name | Value |
275-
+---------+------+--------+
275+
|---------|------|--------|
276276
| 1 | y | 42 |
277277
| 0 | x | ?????? |
278278

@@ -305,7 +305,7 @@ fn main() {
305305
When we enter `main()`, memory looks like this:
306306

307307
| Address | Name | Value |
308-
+---------+------+-------+
308+
|---------|------|-------|
309309
| 1 | y | 0 |
310310
| 0 | x | 5 |
311311

@@ -315,7 +315,7 @@ memory location that `x` lives at, which in this case is `0`.
315315
What about when we call `foo()`, passing `y` as an argument?
316316

317317
| Address | Name | Value |
318-
+---------+------+-------+
318+
|---------|------|-------|
319319
| 3 | z | 42 |
320320
| 2 | i | 0 |
321321
| 1 | y | 0 |
@@ -367,7 +367,7 @@ fn main() {
367367
First, we call `main()`:
368368

369369
| Address | Name | Value |
370-
+-----------------+------+----------------+
370+
|-----------------|------|----------------|
371371
| 2<sup>30</sup> | | 20 |
372372
| ... | ... | ... |
373373
| 2 | j | 0 |
@@ -380,7 +380,7 @@ value pointing there.
380380
Next, at the end of `main()`, `foo()` gets called:
381381

382382
| Address | Name | Value |
383-
+-----------------+------+----------------+
383+
|-----------------|------|----------------|
384384
| 2<sup>30</sup> | | 20 |
385385
| ... | ... | ... |
386386
| 5 | z | 4 |
@@ -397,7 +397,7 @@ since `j` points at `h`.
397397
Next, `foo()` calls `baz()`, passing `z`:
398398

399399
| Address | Name | Value |
400-
+-----------------+------+----------------+
400+
|-----------------|------|----------------|
401401
| 2<sup>30</sup> | | 20 |
402402
| ... | ... | ... |
403403
| 7 | g | 100 |
@@ -413,7 +413,7 @@ We’ve allocated memory for `f` and `g`. `baz()` is very short, so when it’s
413413
over, we get rid of its stack frame:
414414

415415
| Address | Name | Value |
416-
+-----------------+------+----------------+
416+
|-----------------|------|----------------|
417417
| 2<sup>30</sup> | | 20 |
418418
| ... | ... | ... |
419419
| 5 | z | 4 |
@@ -426,11 +426,11 @@ over, we get rid of its stack frame:
426426
Next, `foo()` calls `bar()` with `x` and `z`:
427427

428428
| Address | Name | Value |
429-
+----------------------+------+----------------------+
429+
|----------------------|------|----------------------|
430430
| 2<sup>30</sup> | | 20 |
431431
| (2<sup>30</sup>) - 1 | | 5 |
432432
| ... | ... | ... |
433-
| 10 | e | 4 |
433+
| 10 | e | 9 |
434434
| 9 | d | (2<sup>30</sup>) - 1 |
435435
| 8 | c | 5 |
436436
| 7 | b | 4 |
@@ -449,13 +449,13 @@ case, we set up the variables as usual.
449449
At the end of `bar()`, it calls `baz()`:
450450

451451
| Address | Name | Value |
452-
+----------------------+------+----------------------+
452+
|----------------------|------|----------------------|
453453
| 2<sup>30</sup> | | 20 |
454454
| (2<sup>30</sup>) - 1 | | 5 |
455455
| ... | ... | ... |
456456
| 12 | g | 100 |
457457
| 11 | f | 4 |
458-
| 10 | e | 4 |
458+
| 10 | e | 9 |
459459
| 9 | d | (2<sup>30</sup>) - 1 |
460460
| 8 | c | 5 |
461461
| 7 | b | 4 |
@@ -473,11 +473,11 @@ far.
473473
After `baz()` is over, we get rid of `f` and `g`:
474474

475475
| Address | Name | Value |
476-
+----------------------+------+----------------------+
476+
|----------------------|------|----------------------|
477477
| 2<sup>30</sup> | | 20 |
478478
| (2<sup>30</sup>) - 1 | | 5 |
479479
| ... | ... | ... |
480-
| 10 | e | 4 |
480+
| 10 | e | 9 |
481481
| 9 | d | (2<sup>30</sup>) - 1 |
482482
| 8 | c | 5 |
483483
| 7 | b | 4 |
@@ -493,7 +493,7 @@ Next, we return from `bar()`. `d` in this case is a `Box<T>`, so it also frees
493493
what it points to: (2<sup>30</sup>) - 1.
494494

495495
| Address | Name | Value |
496-
+-----------------+------+----------------+
496+
|-----------------|------|----------------|
497497
| 2<sup>30</sup> | | 20 |
498498
| ... | ... | ... |
499499
| 5 | z | 4 |
@@ -506,7 +506,7 @@ what it points to: (2<sup>30</sup>) - 1.
506506
And after that, `foo()` returns:
507507

508508
| Address | Name | Value |
509-
+-----------------+------+----------------+
509+
|-----------------|------|----------------|
510510
| 2<sup>30</sup> | | 20 |
511511
| ... | ... | ... |
512512
| 2 | j | 0 |

branches/try/src/doc/trpl/while-loops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Rust also has a `while` loop. It looks like this:
44

55
```{rust}
6-
let mut x = 5; // mut x: u32
6+
let mut x = 5; // mut x: i32
77
let mut done = false; // mut done: bool
88
99
while !done {

branches/try/src/libcollections/str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ macro_rules! utf8_acc_cont_byte {
396396

397397
#[stable(feature = "rust1", since = "1.0.0")]
398398
impl Borrow<str> for String {
399+
#[inline]
399400
fn borrow(&self) -> &str { &self[..] }
400401
}
401402

branches/try/src/librustc/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#![feature(box_syntax)]
3131
#![feature(collections)]
3232
#![feature(core)]
33+
#![feature(duration)]
34+
#![feature(duration_span)]
3335
#![feature(fs_canonicalize)]
3436
#![feature(hash)]
3537
#![feature(into_cow)]

branches/try/src/librustc/metadata/loader.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,7 @@ fn get_metadata_section(is_osx: bool, filename: &Path) -> Result<MetadataBlob, S
720720
let dur = Duration::span(|| {
721721
ret = Some(get_metadata_section_imp(is_osx, filename));
722722
});
723-
info!("reading {:?} => {}ms", filename.file_name().unwrap(),
724-
dur.num_milliseconds());
723+
info!("reading {:?} => {}", filename.file_name().unwrap(), dur);
725724
return ret.unwrap();;
726725
}
727726

0 commit comments

Comments
 (0)