Skip to content

Commit f64837a

Browse files
committed
---
yaml --- r: 275149 b: refs/heads/stable c: 43ddfbd h: refs/heads/master i: 275147: 8dddccc
1 parent 9343299 commit f64837a

File tree

207 files changed

+6174
-2655
lines changed

Some content is hidden

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

207 files changed

+6174
-2655
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 409bffa6545ffb760403a82f5fb27678ad2a0aca
32+
refs/heads/stable: 43ddfbdfb2cfc63646db395751f108617f0e39b4
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
url = https://github.com/rust-lang/rust-installer.git
1717
[submodule "src/liblibc"]
1818
path = src/liblibc
19-
url = https://github.com/rust-lang-nursery/libc.git
19+
url = https://github.com/rust-lang/libc.git

branches/stable/.mailmap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Gareth Daniel Smith <garethdanielsmith@gmail.com> Gareth Smith <garethdanielsmit
8282
Georges Dubus <georges.dubus@gmail.com> <georges.dubus@compiletoi.net>
8383
Graham Fawcett <graham.fawcett@gmail.com> Graham Fawcett <fawcett@uwindsor.ca>
8484
Graydon Hoare <graydon@pobox.com> Graydon Hoare <graydon@mozilla.com>
85-
Guillaume Gomez <guillaume1.gomez@gmail.com>
85+
Guillaume Gomez <guillaume1.gomez@gmail.com> Guillaume Gomez <ggomez@ggo.ifr.lan>
8686
Heather <heather@cynede.net> <Cynede@Gentoo.org>
8787
Heather <heather@cynede.net> <Heather@cynede.net>
8888
Herman J. Radtke III <herman@hermanradtke.com> Herman J. Radtke III <hermanradtke@gmail.com>

branches/stable/RELEASES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ Misc
9494
the `-Z unstable-options` flag.
9595
* [When running tests with `--test`, rustdoc will pass `--cfg`
9696
arguments to the compiler][1.7dt].
97-
* [The compiler is built with RPATH information by default][1.7rp].
97+
* [The compiler is built with RPATH information by default][1.7rpa].
9898
This means that it will be possible to run `rustc` when installed in
9999
unusual configurations without configuring the dynamic linker search
100100
path explicitly.
101-
* [`rustc` passes `--enable-new-dtags` to GNU ld][1.7dt]. This makes
101+
* [`rustc` passes `--enable-new-dtags` to GNU ld][1.7dta]. This makes
102102
any RPATH entries (emitted with `-C rpath`) *not* take precedence
103103
over `LD_LIBRARY_PATH`.
104104

@@ -132,15 +132,15 @@ Compatibility Notes
132132
[1.7cp]: https://github.com/rust-lang/cargo/pull/2224
133133
[1.7d]: https://github.com/rust-lang/rust/pull/30724
134134
[1.7dt]: https://github.com/rust-lang/rust/pull/30372
135-
[1.7dt]: https://github.com/rust-lang/rust/pull/30394
135+
[1.7dta]: https://github.com/rust-lang/rust/pull/30394
136136
[1.7f]: https://github.com/rust-lang/rust/pull/30672
137137
[1.7h]: https://github.com/rust-lang/rust/pull/30818
138138
[1.7j]: https://github.com/rust-lang/rust/pull/30711
139139
[1.7ll]: https://github.com/rust-lang/rust/pull/30663
140140
[1.7m]: https://github.com/rust-lang/rust/pull/30381
141141
[1.7p]: https://github.com/rust-lang/rust/pull/30681
142142
[1.7rp]: https://github.com/rust-lang/rust/pull/29498
143-
[1.7rp]: https://github.com/rust-lang/rust/pull/30353
143+
[1.7rpa]: https://github.com/rust-lang/rust/pull/30353
144144
[1.7rr]: https://github.com/rust-lang/cargo/pull/2279
145145
[1.7sf]: https://github.com/rust-lang/rust/pull/30389
146146
[1.7utf8]: https://github.com/rust-lang/rust/pull/30740

branches/stable/configure

Lines changed: 85 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,97 +1327,101 @@ then
13271327
fi
13281328
fi
13291329

1330-
step_msg "making directories"
1330+
if [ -z "$CFG_ENABLE_RUSTBUILD" ]; then
13311331

1332-
for i in \
1333-
doc doc/std doc/extra \
1334-
dl tmp dist
1335-
do
1336-
make_dir $i
1337-
done
1332+
step_msg "making directories"
13381333

1339-
for t in $CFG_HOST
1340-
do
1341-
make_dir $t/llvm
1342-
done
1334+
for i in \
1335+
doc doc/std doc/extra \
1336+
dl tmp dist
1337+
do
1338+
make_dir $i
1339+
done
13431340

1344-
for t in $CFG_HOST
1345-
do
1346-
make_dir $t/rustllvm
1347-
done
1341+
for t in $CFG_HOST
1342+
do
1343+
make_dir $t/llvm
1344+
done
13481345

1349-
for t in $CFG_TARGET
1350-
do
1351-
make_dir $t/rt
1352-
for s in 0 1 2 3
1346+
for t in $CFG_HOST
13531347
do
1354-
make_dir $t/rt/stage$s
1355-
make_dir $t/rt/jemalloc
1356-
make_dir $t/rt/compiler-rt
1357-
for i in \
1358-
isaac sync test \
1359-
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips arch/powerpc
1360-
do
1361-
make_dir $t/rt/stage$s/$i
1362-
done
1348+
make_dir $t/rustllvm
13631349
done
1364-
done
13651350

1366-
for h in $CFG_HOST
1367-
do
1368-
for t in $CFG_TARGET
1351+
for t in $CFG_TARGET
1352+
do
1353+
make_dir $t/rt
1354+
for s in 0 1 2 3
13691355
do
1370-
# host bin dir stage0
1371-
make_dir $h/stage0/bin
1372-
1373-
# host lib dir stage0
1374-
make_dir $h/stage0/lib
1375-
1376-
# host test dir stage0
1377-
make_dir $h/stage0/test
1378-
1379-
# target bin dir stage0
1380-
make_dir $h/stage0/lib/rustlib/$t/bin
1381-
1382-
# target lib dir stage0
1383-
make_dir $h/stage0/lib/rustlib/$t/lib
1384-
1385-
for i in 1 2 3
1386-
do
1387-
# host bin dir
1388-
make_dir $h/stage$i/bin
1389-
1390-
# host lib dir
1391-
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE
1392-
1393-
# host test dir
1394-
make_dir $h/stage$i/test
1395-
1396-
# target bin dir
1397-
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/bin
1398-
1399-
# target lib dir
1400-
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/lib
1401-
done
1356+
make_dir $t/rt/stage$s
1357+
make_dir $t/rt/jemalloc
1358+
make_dir $t/rt/compiler-rt
1359+
for i in \
1360+
isaac sync test \
1361+
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips arch/powerpc
1362+
do
1363+
make_dir $t/rt/stage$s/$i
1364+
done
14021365
done
1366+
done
14031367

1404-
make_dir $h/test/run-pass
1405-
make_dir $h/test/run-pass-valgrind
1406-
make_dir $h/test/run-pass-fulldeps
1407-
make_dir $h/test/run-fail
1408-
make_dir $h/test/run-fail-fulldeps
1409-
make_dir $h/test/compile-fail
1410-
make_dir $h/test/parse-fail
1411-
make_dir $h/test/compile-fail-fulldeps
1412-
make_dir $h/test/bench
1413-
make_dir $h/test/perf
1414-
make_dir $h/test/pretty
1415-
make_dir $h/test/debuginfo-gdb
1416-
make_dir $h/test/debuginfo-lldb
1417-
make_dir $h/test/codegen
1418-
make_dir $h/test/codegen-units
1419-
make_dir $h/test/rustdoc
1420-
done
1368+
for h in $CFG_HOST
1369+
do
1370+
for t in $CFG_TARGET
1371+
do
1372+
# host bin dir stage0
1373+
make_dir $h/stage0/bin
1374+
1375+
# host lib dir stage0
1376+
make_dir $h/stage0/lib
1377+
1378+
# host test dir stage0
1379+
make_dir $h/stage0/test
1380+
1381+
# target bin dir stage0
1382+
make_dir $h/stage0/lib/rustlib/$t/bin
1383+
1384+
# target lib dir stage0
1385+
make_dir $h/stage0/lib/rustlib/$t/lib
1386+
1387+
for i in 1 2 3
1388+
do
1389+
# host bin dir
1390+
make_dir $h/stage$i/bin
1391+
1392+
# host lib dir
1393+
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE
1394+
1395+
# host test dir
1396+
make_dir $h/stage$i/test
1397+
1398+
# target bin dir
1399+
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/bin
1400+
1401+
# target lib dir
1402+
make_dir $h/stage$i/$CFG_LIBDIR_RELATIVE/rustlib/$t/lib
1403+
done
1404+
done
1405+
1406+
make_dir $h/test/run-pass
1407+
make_dir $h/test/run-pass-valgrind
1408+
make_dir $h/test/run-pass-fulldeps
1409+
make_dir $h/test/run-fail
1410+
make_dir $h/test/run-fail-fulldeps
1411+
make_dir $h/test/compile-fail
1412+
make_dir $h/test/parse-fail
1413+
make_dir $h/test/compile-fail-fulldeps
1414+
make_dir $h/test/bench
1415+
make_dir $h/test/perf
1416+
make_dir $h/test/pretty
1417+
make_dir $h/test/debuginfo-gdb
1418+
make_dir $h/test/debuginfo-lldb
1419+
make_dir $h/test/codegen
1420+
make_dir $h/test/codegen-units
1421+
make_dir $h/test/rustdoc
1422+
done
1423+
1424+
fi
14211425

14221426
# Configure submodules
14231427
step_msg "configuring submodules"

branches/stable/mk/cfg/armv7-unknown-linux-gnueabihf.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ CFG_UNIXY_armv7-unknown-linux-gnueabihf := 1
2121
CFG_LDPATH_armv7-unknown-linux-gnueabihf :=
2222
CFG_RUN_armv7-unknown-linux-gnueabihf=$(2)
2323
CFG_RUN_TARG_armv7-unknown-linux-gnueabihf=$(call CFG_RUN_armv7-unknown-linux-gnueabihf,,$(2))
24-
RUSTC_FLAGS_armv7-unknown-linux-gnueabihf := -C target-feature=+v7,+vfp2,+neon
24+
RUSTC_FLAGS_armv7-unknown-linux-gnueabihf :=
2525
RUSTC_CROSS_FLAGS_armv7-unknown-linux-gnueabihf :=
2626
CFG_GNU_TRIPLE_armv7-unknown-linux-gnueabihf := armv7-unknown-linux-gnueabihf

branches/stable/mk/dist.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ PKG_FILES := \
4848
$(S)configure $(S)Makefile.in \
4949
$(S)man \
5050
$(addprefix $(S)src/, \
51+
bootstrap \
52+
build_helper \
5153
compiletest \
5254
doc \
5355
driver \
@@ -60,6 +62,7 @@ PKG_FILES := \
6062
rt \
6163
rtstartup \
6264
rustllvm \
65+
rustc \
6366
snapshots.txt \
6467
rust-installer \
6568
rustbook \

branches/stable/src/bootstrap/build/mod.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,25 @@ impl Build {
160160
if fs::metadata(self.src.join(".git")).is_err() {
161161
return
162162
}
163-
let out = output(Command::new("git").arg("submodule").arg("status"));
163+
let git_submodule = || {
164+
let mut cmd = Command::new("git");
165+
cmd.current_dir(&self.src).arg("submodule");
166+
return cmd
167+
};
168+
let out = output(git_submodule().arg("status"));
164169
if !out.lines().any(|l| l.starts_with("+") || l.starts_with("-")) {
165170
return
166171
}
167172

168-
self.run(Command::new("git").arg("submodule").arg("sync"));
169-
self.run(Command::new("git").arg("submodule").arg("init"));
170-
self.run(Command::new("git").arg("submodule").arg("update"));
171-
self.run(Command::new("git").arg("submodule").arg("update")
172-
.arg("--recursive"));
173-
self.run(Command::new("git").arg("submodule").arg("status")
174-
.arg("--recursive"));
175-
self.run(Command::new("git").arg("submodule").arg("foreach")
176-
.arg("--recursive")
177-
.arg("git").arg("clean").arg("-fdx"));
178-
self.run(Command::new("git").arg("submodule").arg("foreach")
179-
.arg("--recursive")
180-
.arg("git").arg("checkout").arg("."));
173+
self.run(git_submodule().arg("sync"));
174+
self.run(git_submodule().arg("init"));
175+
self.run(git_submodule().arg("update"));
176+
self.run(git_submodule().arg("update").arg("--recursive"));
177+
self.run(git_submodule().arg("status").arg("--recursive"));
178+
self.run(git_submodule().arg("foreach").arg("--recursive")
179+
.arg("git").arg("clean").arg("-fdx"));
180+
self.run(git_submodule().arg("foreach").arg("--recursive")
181+
.arg("git").arg("checkout").arg("."));
181182
}
182183

183184
/// Clear out `dir` if our build has been flagged as dirty, and also set

branches/stable/src/doc/book/guessing-game.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ done:
258258
io::stdin().read_line(&mut guess).expect("failed to read line");
259259
```
260260

261-
But that gets hard to read. So we’ve split it up, three lines for three method
261+
But that gets hard to read. So we’ve split it up, two lines for two method
262262
calls. We already talked about `read_line()`, but what about `expect()`? Well,
263263
we already mentioned that `read_line()` puts what the user types into the `&mut
264264
String` we pass it. But it also returns a value: in this case, an
@@ -644,7 +644,7 @@ So far, that hasn’t mattered, and so Rust defaults to an `i32`. However, here,
644644
Rust doesn’t know how to compare the `guess` and the `secret_number`. They
645645
need to be the same type. Ultimately, we want to convert the `String` we
646646
read as input into a real number type, for comparison. We can do that
647-
with three more lines. Here’s our new program:
647+
with two more lines. Here’s our new program:
648648
649649
```rust,ignore
650650
extern crate rand;

branches/stable/src/doc/book/ownership.md

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,65 @@ special annotation here, it’s the default thing that Rust does.
124124
## The details
125125

126126
The reason that we cannot use a binding after we’ve moved it is subtle, but
127-
important. When we write code like this:
127+
important.
128+
129+
When we write code like this:
130+
131+
```rust
132+
let x = 10;
133+
```
134+
135+
Rust allocates memory for an integer [i32] on the [stack][sh], copies the bit
136+
pattern representing the value of 10 to the allocated memory and binds the
137+
variable name x to this memory region for future reference.
138+
139+
Now consider the following code fragment:
128140

129141
```rust
130142
let v = vec![1, 2, 3];
131143

132-
let v2 = v;
144+
let mut v2 = v;
145+
```
146+
147+
The first line allocates memory for the vector object `v` on the stack like
148+
it does for `x` above. But in addition to that it also allocates some memory
149+
on the [heap][sh] for the actual data (`[1, 2, 3]`). Rust copies the address
150+
of this heap allocation to an internal pointer, which is part of the vector
151+
object placed on the stack (let's call it the data pointer).
152+
153+
It is worth pointing out (even at the risk of stating the obvious) that the
154+
vector object and its data live in separate memory regions instead of being a
155+
single contiguous memory allocation (due to reasons we will not go into at
156+
this point of time). These two parts of the vector (the one on the stack and
157+
one on the heap) must agree with each other at all times with regards to
158+
things like the length, capacity etc.
159+
160+
When we move `v` to `v2`, rust actually does a bitwise copy of the vector
161+
object `v` into the stack allocation represented by `v2`. This shallow copy
162+
does not create a copy of the heap allocation containing the actual data.
163+
Which means that there would be two pointers to the contents of the vector
164+
both pointing to the same memory allocation on the heap. It would violate
165+
Rust’s safety guarantees by introducing a data race if one could access both
166+
`v` and `v2` at the same time.
167+
168+
For example if we truncated the vector to just two elements through `v2`:
169+
170+
```rust
171+
# let v = vec![1, 2, 3];
172+
# let mut v2 = v;
173+
v2.truncate(2);
133174
```
134175

135-
The first line allocates memory for the vector object, `v`, and for the data it
136-
contains. The vector object is stored on the [stack][sh] and contains a pointer
137-
to the content (`[1, 2, 3]`) stored on the [heap][sh]. When we move `v` to `v2`,
138-
it creates a copy of that pointer, for `v2`. Which means that there would be two
139-
pointers to the content of the vector on the heap. It would violate Rust’s
140-
safety guarantees by introducing a data race. Therefore, Rust forbids using `v`
141-
after we’ve done the move.
176+
and `v1` were still accessible we'd end up with an invalid vector since `v1`
177+
would not know that the heap data has been truncated. Now, the part of the
178+
vector `v1` on the stack does not agree with the corresponding part on the
179+
heap. `v1` still thinks there are three elements in the vector and will
180+
happily let us access the non existent element `v1[2]` but as you might
181+
already know this is a recipe for disaster. Especially because it might lead
182+
to a segmentation fault or worse allow an unauthorized user to read from
183+
memory to which they don't have access.
184+
185+
This is why Rust forbids using `v` after we’ve done the move.
142186

143187
[sh]: the-stack-and-the-heap.html
144188

0 commit comments

Comments
 (0)