Skip to content

Commit a89454a

Browse files
committed
---
yaml --- r: 208871 b: refs/heads/snap-stage3 c: ba0e1cd h: refs/heads/master i: 208869: 6205fd9 208867: f69c20b 208863: 23426ab v: v3
1 parent c6cb6ba commit a89454a

Some content is hidden

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

63 files changed

+676
-404
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: 82ded3cd03e001e82b9dce9aedac621a5292231b
4+
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/configure

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
msg() {
4-
echo "configure: $1"
4+
echo "configure: $*"
55
}
66

77
step_msg() {
@@ -33,8 +33,8 @@ need_ok() {
3333

3434
need_cmd() {
3535
if command -v $1 >/dev/null 2>&1
36-
then msg "found program $1"
37-
else err "need program $1"
36+
then msg "found program '$1'"
37+
else err "program '$1' is missing, please install it"
3838
fi
3939
}
4040

@@ -986,7 +986,7 @@ then
986986
| cut -d ' ' -f 2)
987987

988988
case $CFG_CLANG_VERSION in
989-
(3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
989+
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7*)
990990
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
991991
if [ -z "$CC" ]
992992
then

branches/snap-stage3/mk/cfg/i686-apple-darwin.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# i686-apple-darwin configuration
22
CC_i686-apple-darwin=$(CC)
3+
LINK_i686-apple-darwin=cc
34
CXX_i686-apple-darwin=$(CXX)
45
CPP_i686-apple-darwin=$(CPP)
56
AR_i686-apple-darwin=$(AR)

branches/snap-stage3/mk/cfg/i686-unknown-linux-gnu.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# i686-unknown-linux-gnu configuration
22
CC_i686-unknown-linux-gnu=$(CC)
3+
LINK_i686-unknown-linux-gnu=cc
34
CXX_i686-unknown-linux-gnu=$(CXX)
45
CPP_i686-unknown-linux-gnu=$(CPP)
56
AR_i686-unknown-linux-gnu=$(AR)

branches/snap-stage3/mk/cfg/x86_64-apple-darwin.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# x86_64-apple-darwin configuration
22
CC_x86_64-apple-darwin=$(CC)
3+
LINK_x86_64-apple-darwin=cc
34
CXX_x86_64-apple-darwin=$(CXX)
45
CPP_x86_64-apple-darwin=$(CPP)
56
AR_x86_64-apple-darwin=$(AR)

branches/snap-stage3/mk/cfg/x86_64-unknown-linux-gnu.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# x86_64-unknown-linux-gnu configuration
22
CC_x86_64-unknown-linux-gnu=$(CC)
3+
LINK_x86_64-unknown-linux-gnu=cc
34
CXX_x86_64-unknown-linux-gnu=$(CXX)
45
CPP_x86_64-unknown-linux-gnu=$(CPP)
56
AR_x86_64-unknown-linux-gnu=$(AR)

branches/snap-stage3/mk/dist.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
123123
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
124124
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
125125
dist-install-dir-$(1): PREPARE_CLEAN=true
126-
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
126+
dist-install-dir-$(1): prepare-base-dir-$(1) docs
127127
$$(Q)mkdir -p $$(PREPARE_DEST_DIR)/share/doc/rust
128128
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)/share/doc/rust
129129
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)/share/doc/rust
@@ -163,7 +163,7 @@ endif
163163
--legacy-manifest-dirs=rustlib,cargo
164164
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
165165

166-
dist-doc-install-dir-$(1): docs compiler-docs
166+
dist-doc-install-dir-$(1): docs
167167
$$(Q)mkdir -p tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust
168168
$$(Q)cp -r doc tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust/html
169169

@@ -251,7 +251,7 @@ distcheck-tar-bins: dist-tar-bins
251251

252252
# Just copy the docs to a folder under dist with the appropriate name
253253
# for uploading to S3
254-
dist-docs: docs compiler-docs
254+
dist-docs: docs
255255
$(Q) rm -Rf dist/doc
256256
$(Q) mkdir -p dist/doc/
257257
$(Q) cp -r doc dist/doc/$(CFG_PACKAGE_VERS)

branches/snap-stage3/mk/docs.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
7777

7878
D := $(S)src/doc
7979

80-
DOC_TARGETS := trpl style error-index
80+
# FIXME (#25705) eventually may want to put error-index target back here.
81+
DOC_TARGETS := trpl style
8182
COMPILER_DOC_TARGETS :=
8283
DOC_L10N_TARGETS :=
8384

branches/snap-stage3/src/doc/reference.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,10 @@ arbitrarily complex configurations through nesting.
20032003

20042004
The following configurations must be defined by the implementation:
20052005

2006+
* `debug_assertions`. Enabled by default when compiling without optimizations.
2007+
This can be used to enable extra debugging code in development but not in
2008+
production. For example, it controls the behavior of the standard library's
2009+
`debug_assert!` macro.
20062010
* `target_arch = "..."`. Target CPU architecture, such as `"x86"`, `"x86_64"`
20072011
`"mips"`, `"powerpc"`, `"arm"`, or `"aarch64"`.
20082012
* `target_endian = "..."`. Endianness of the target CPU, either `"little"` or
@@ -3622,6 +3626,14 @@ The `Sized` trait indicates that the size of this type is known at compile-time.
36223626
The `Drop` trait provides a destructor, to be run whenever a value of this type
36233627
is to be destroyed.
36243628

3629+
## The `Deref` trait
3630+
3631+
The `Deref<Target = U>` trait allows a type to implicitly implement all the methods
3632+
of the type `U`. When attempting to resolve a method call, the compiler will search
3633+
the top-level type for the implementation of the called method. If no such method is
3634+
found, `.deref()` is called and the compiler continues to search for the method
3635+
implementation in the returned type `U`.
3636+
36253637
# Memory model
36263638

36273639
A Rust program's memory consists of a static set of *items* and a *heap*.

branches/snap-stage3/src/doc/trpl/dining-philosophers.md

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
22

33
For our second project, let’s look at a classic concurrency problem. It’s
44
called ‘the dining philosophers’. It was originally conceived by Dijkstra in
5-
1965, but we’ll use the version from [this paper][paper] by Tony Hoare in 1985.
5+
1965, but we’ll use a lightly adapted version from [this paper][paper] by Tony
6+
Hoare in 1985.
67

78
[paper]: http://www.usingcsp.com/cspbook.pdf
89

910
> In ancient times, a wealthy philanthropist endowed a College to accommodate
10-
> five eminent philosophers. Each philosopher had a room in which she could
11-
> engage in her professional activity of thinking; there was also a common
11+
> five eminent philosophers. Each philosopher had a room in which they could
12+
> engage in their professional activity of thinking; there was also a common
1213
> dining room, furnished with a circular table, surrounded by five chairs, each
1314
> labelled by the name of the philosopher who was to sit in it. They sat
1415
> anticlockwise around the table. To the left of each philosopher there was
1516
> laid a golden fork, and in the centre stood a large bowl of spaghetti, which
16-
> was constantly replenished. A philosopher was expected to spend most of her
17-
> time thinking; but when she felt hungry, she went to the dining room, sat down
18-
> in her own chair, picked up her own fork on her left, and plunged it into the
19-
> spaghetti. But such is the tangled nature of spaghetti that a second fork is
20-
> required to carry it to the mouth. The philosopher therefore had also to pick
21-
> up the fork on her right. When she was finished she would put down both her
22-
> forks, get up from her chair, and continue thinking. Of course, a fork can be
23-
> used by only one philosopher at a time. If the other philosopher wants it, she
24-
> just has to wait until the fork is available again.
17+
> was constantly replenished. A philosopher was expected to spend most of
18+
> their time thinking; but when they felt hungry, they went to the dining
19+
> room, sat down in their own chair, picked up their own fork on their left,
20+
> and plunged it into the spaghetti. But such is the tangled nature of
21+
> spaghetti that a second fork is required to carry it to the mouth. The
22+
> philosopher therefore had also to pick up the fork on their right. When
23+
> they were finished they would put down both their forks, get up from their
24+
> chair, and continue thinking. Of course, a fork can be used by only one
25+
> philosopher at a time. If the other philosopher wants it, they just have
26+
> to wait until the fork is available again.
2527
2628
This classic problem shows off a few different elements of concurrency. The
2729
reason is that it's actually slightly tricky to implement: a simple
@@ -60,10 +62,10 @@ impl Philosopher {
6062
}
6163

6264
fn main() {
63-
let p1 = Philosopher::new("Baruch Spinoza");
65+
let p1 = Philosopher::new("Judith Butler");
6466
let p2 = Philosopher::new("Gilles Deleuze");
6567
let p3 = Philosopher::new("Karl Marx");
66-
let p4 = Philosopher::new("Friedrich Nietzsche");
68+
let p4 = Philosopher::new("Emma Goldman");
6769
let p5 = Philosopher::new("Michel Foucault");
6870
}
6971
```
@@ -159,10 +161,10 @@ look at `main()` again:
159161
# }
160162
#
161163
fn main() {
162-
let p1 = Philosopher::new("Baruch Spinoza");
164+
let p1 = Philosopher::new("Judith Butler");
163165
let p2 = Philosopher::new("Gilles Deleuze");
164166
let p3 = Philosopher::new("Karl Marx");
165-
let p4 = Philosopher::new("Friedrich Nietzsche");
167+
let p4 = Philosopher::new("Emma Goldman");
166168
let p5 = Philosopher::new("Michel Foucault");
167169
}
168170
```
@@ -176,10 +178,10 @@ that `new()` function, it would look like this:
176178
# name: String,
177179
# }
178180
fn main() {
179-
let p1 = Philosopher { name: "Baruch Spinoza".to_string() };
181+
let p1 = Philosopher { name: "Judith Butler".to_string() };
180182
let p2 = Philosopher { name: "Gilles Deleuze".to_string() };
181183
let p3 = Philosopher { name: "Karl Marx".to_string() };
182-
let p4 = Philosopher { name: "Friedrich Nietzche".to_string() };
184+
let p4 = Philosopher { name: "Emma Goldman".to_string() };
183185
let p5 = Philosopher { name: "Michel Foucault".to_string() };
184186
}
185187
```
@@ -211,10 +213,10 @@ impl Philosopher {
211213

212214
fn main() {
213215
let philosophers = vec![
214-
Philosopher::new("Baruch Spinoza"),
216+
Philosopher::new("Judith Butler"),
215217
Philosopher::new("Gilles Deleuze"),
216218
Philosopher::new("Karl Marx"),
217-
Philosopher::new("Friedrich Nietzsche"),
219+
Philosopher::new("Emma Goldman"),
218220
Philosopher::new("Michel Foucault"),
219221
];
220222

@@ -247,10 +249,10 @@ mention they’re done eating. Running this program should give you the followin
247249
output:
248250

249251
```text
250-
Baruch Spinoza is done eating.
252+
Judith Butler is done eating.
251253
Gilles Deleuze is done eating.
252254
Karl Marx is done eating.
253-
Friedrich Nietzsche is done eating.
255+
Emma Goldman is done eating.
254256
Michel Foucault is done eating.
255257
```
256258

@@ -285,10 +287,10 @@ impl Philosopher {
285287

286288
fn main() {
287289
let philosophers = vec![
288-
Philosopher::new("Baruch Spinoza"),
290+
Philosopher::new("Judith Butler"),
289291
Philosopher::new("Gilles Deleuze"),
290292
Philosopher::new("Karl Marx"),
291-
Philosopher::new("Friedrich Nietzsche"),
293+
Philosopher::new("Emma Goldman"),
292294
Philosopher::new("Michel Foucault"),
293295
];
294296

@@ -323,14 +325,14 @@ simulate the time it takes a philosopher to eat.
323325
If you run this program, you should see each philosopher eat in turn:
324326

325327
```text
326-
Baruch Spinoza is eating.
327-
Baruch Spinoza is done eating.
328+
Judith Butler is eating.
329+
Judith Butler is done eating.
328330
Gilles Deleuze is eating.
329331
Gilles Deleuze is done eating.
330332
Karl Marx is eating.
331333
Karl Marx is done eating.
332-
Friedrich Nietzsche is eating.
333-
Friedrich Nietzsche is done eating.
334+
Emma Goldman is eating.
335+
Emma Goldman is done eating.
334336
Michel Foucault is eating.
335337
Michel Foucault is done eating.
336338
```
@@ -366,10 +368,10 @@ impl Philosopher {
366368

367369
fn main() {
368370
let philosophers = vec![
369-
Philosopher::new("Baruch Spinoza"),
371+
Philosopher::new("Judith Butler"),
370372
Philosopher::new("Gilles Deleuze"),
371373
Philosopher::new("Karl Marx"),
372-
Philosopher::new("Friedrich Nietzsche"),
374+
Philosopher::new("Emma Goldman"),
373375
Philosopher::new("Michel Foucault"),
374376
];
375377

@@ -458,11 +460,11 @@ We have multi-threading!
458460
```text
459461
Gilles Deleuze is eating.
460462
Gilles Deleuze is done eating.
461-
Friedrich Nietzsche is eating.
462-
Friedrich Nietzsche is done eating.
463+
Emma Goldman is eating.
464+
Emma Goldman is done eating.
463465
Michel Foucault is eating.
464-
Baruch Spinoza is eating.
465-
Baruch Spinoza is done eating.
466+
Judith Butler is eating.
467+
Judith Butler is done eating.
466468
Karl Marx is eating.
467469
Karl Marx is done eating.
468470
Michel Foucault is done eating.
@@ -532,10 +534,10 @@ fn main() {
532534
]});
533535

534536
let philosophers = vec![
535-
Philosopher::new("Baruch Spinoza", 0, 1),
537+
Philosopher::new("Judith Butler", 0, 1),
536538
Philosopher::new("Gilles Deleuze", 1, 2),
537539
Philosopher::new("Karl Marx", 2, 3),
538-
Philosopher::new("Friedrich Nietzsche", 3, 4),
540+
Philosopher::new("Emma Goldman", 3, 4),
539541
Philosopher::new("Michel Foucault", 0, 4),
540542
];
541543

@@ -643,10 +645,10 @@ count will go up, and when each thread ends, it will go back down.
643645

644646
```rust,ignore
645647
let philosophers = vec![
646-
Philosopher::new("Baruch Spinoza", 0, 1),
648+
Philosopher::new("Judith Butler", 0, 1),
647649
Philosopher::new("Gilles Deleuze", 1, 2),
648650
Philosopher::new("Karl Marx", 2, 3),
649-
Philosopher::new("Friedrich Nietzsche", 3, 4),
651+
Philosopher::new("Emma Goldman", 3, 4),
650652
Philosopher::new("Michel Foucault", 0, 4),
651653
];
652654
```
@@ -679,12 +681,12 @@ and so you’ll get some output like this:
679681

680682
```text
681683
Gilles Deleuze is eating.
682-
Friedrich Nietzsche is eating.
683-
Friedrich Nietzsche is done eating.
684+
Emma Goldman is eating.
685+
Emma Goldman is done eating.
684686
Gilles Deleuze is done eating.
685-
Baruch Spinoza is eating.
687+
Judith Butler is eating.
686688
Karl Marx is eating.
687-
Baruch Spinoza is done eating.
689+
Judith Butler is done eating.
688690
Michel Foucault is eating.
689691
Karl Marx is done eating.
690692
Michel Foucault is done eating.

branches/snap-stage3/src/doc/trpl/guessing-game.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ a few tricks up their sleeves.
148148
For example, they’re [immutable][immutable] by default. That’s why our example
149149
uses `mut`: it makes a binding mutable, rather than immutable. `let` doesn’t
150150
take a name on the left hand side, it actually accepts a
151-
[pattern][patterns]’. We’ll use patterns more later. It’s easy enough
151+
[pattern][patterns]’. We’ll use patterns later. It’s easy enough
152152
to use for now:
153153

154154
```rust
@@ -637,7 +637,7 @@ When we wrote `let guess = String::new()`, Rust was able to infer that `guess`
637637
should be a `String`, and so it doesn’t make us write out the type. And with
638638
our `secret_number`, there are a number of types which can have a value
639639
between one and a hundred: `i32`, a thirty-two-bit number, or `u32`, an
640-
unsigned thirty-two-bit number, or `i64`, a sixty-four-bit number. Or others.
640+
unsigned thirty-two-bit number, or `i64`, a sixty-four-bit number or others.
641641
So far, that hasn’t mattered, and so Rust defaults to an `i32`. However, here,
642642
Rust doesn’t know how to compare the `guess` and the `secret_number`. They
643643
need to be the same type. Ultimately, we want to convert the `String` we

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ allocated on the heap:
277277
| 0 | x | ?????? |
278278

279279
[drop]: drop.html
280-
[moving]: We can make the memory live longer by transferring ownership,
281-
sometimes called ‘moving out of the box’. More complex examples will
282-
be covered later.
280+
[^moving]: We can make the memory live longer by transferring ownership,
281+
sometimes called ‘moving out of the box’. More complex examples will
282+
be covered later.
283283

284284

285285
And then the stack frame goes away, freeing all of our memory.

branches/snap-stage3/src/liballoc/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
//! // At the end of the method, gadget_owner, gadget1 and gadget2 get
145145
//! // destroyed. There are now no strong (`Rc<T>`) references to the gadgets.
146146
//! // Once they get destroyed, the Gadgets get destroyed. This zeroes the
147-
//! // reference count on Gadget Man, so he gets destroyed as well.
147+
//! // reference count on Gadget Man, they get destroyed as well.
148148
//! }
149149
//! ```
150150

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#![feature(str_char)]
4040
#![feature(str_words)]
4141
#![feature(slice_patterns)]
42-
#![feature(debug_builders)]
4342
#![feature(utf8_error)]
4443
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections,
4544
collections_drain, collections_range))]

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,9 +1110,8 @@ impl str {
11101110
/// such as leaving a combining character as the first code point of the
11111111
/// string.
11121112
///
1113-
/// Due to the design of UTF-8, this operation is `O(end)`. See `slice`,
1114-
/// `slice_to` and `slice_from` for `O(1)` variants that use byte indices
1115-
/// rather than code point indices.
1113+
/// Due to the design of UTF-8, this operation is `O(end)`. Use slicing
1114+
/// syntax if you want to use byte indices rather than codepoint indices.
11161115
///
11171116
/// # Panics
11181117
///

0 commit comments

Comments
 (0)