Skip to content

Commit 86d4d92

Browse files
committed
---
yaml --- r: 272983 b: refs/heads/beta c: 76bcf64 h: refs/heads/master i: 272981: edd9b01 272979: f7ced70 272975: e528058
1 parent 3273bc3 commit 86d4d92

File tree

330 files changed

+6835
-4602
lines changed

Some content is hidden

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

330 files changed

+6835
-4602
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: df550de689c27803c9b8d961c747e09cca36fd3e
26+
refs/heads/beta: 76bcf6430f0629931bbbc5c28d2e54a888bdea93
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ build.
7777
7878
Download [MinGW from
7979
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
80-
`threads=win32,exceptions=dwarf/seh` flavor when installing. After installing,
80+
`threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
8181
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
8282
installing from pacman should be just fine.
8383

branches/beta/mk/cfg/i686-pc-windows-gnu.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ CFG_GNU_TRIPLE_i686-pc-windows-gnu := i686-w64-mingw32
2525
CFG_THIRD_PARTY_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o
2626
CFG_INSTALLED_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o
2727
CFG_RUSTRT_HAS_STARTUP_OBJS_i686-pc-windows-gnu := 1
28-
# FIXME(#31030) - there's not a great reason to disable jemalloc here
29-
CFG_DISABLE_JEMALLOC_i686-pc-windows-gnu := 1

branches/beta/mk/cfg/x86_64-pc-windows-gnu.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ CFG_GNU_TRIPLE_x86_64-pc-windows-gnu := x86_64-w64-mingw32
2525
CFG_THIRD_PARTY_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o
2626
CFG_INSTALLED_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o
2727
CFG_RUSTRT_HAS_STARTUP_OBJS_x86_64-pc-windows-gnu := 1
28-
# FIXME(#31030) - there's not a great reason to disable jemalloc here
29-
CFG_DISABLE_JEMALLOC_x86_64-pc-windows-gnu := 1

branches/beta/mk/crates.mk

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std flate arena term \
53-
serialize getopts collections test rand \
54-
log graphviz core rbml alloc \
52+
TARGET_CRATES := libc std term \
53+
getopts collections test rand \
54+
core alloc \
5555
rustc_unicode rustc_bitflags \
5656
alloc_system alloc_jemalloc
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
6060
rustc_plugin rustc_metadata rustc_passes
61-
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros
61+
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
62+
flate arena graphviz rbml log serialize
6263
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
6364

6465
DEPS_core :=
@@ -84,10 +85,10 @@ DEPS_log := std
8485
DEPS_num := std
8586
DEPS_rbml := std log serialize
8687
DEPS_serialize := std log
87-
DEPS_term := std log
88-
DEPS_test := std getopts serialize rbml term native:rust_test_helpers
88+
DEPS_term := std
89+
DEPS_test := std getopts term native:rust_test_helpers
8990

90-
DEPS_syntax := std term serialize log arena libc rustc_bitflags
91+
DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode
9192
DEPS_syntax_ext := syntax fmt_macros
9293

9394
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\

branches/beta/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ COMPRT_AR_$(1) := $$(AR_$(1))
253253
# We chomp -Werror here because GCC warns about the type signature of
254254
# builtins not matching its own and the build fails. It's a bit hacky,
255255
# but what can we do, we're building libclang-rt using GCC ......
256-
COMPRT_CFLAGS_$(1) := $$(filter-out -Werror -Werror=*,$$(CFG_GCCISH_CFLAGS_$(1))) -std=c99
256+
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -Wno-error -std=c99
257257

258258
# FreeBSD Clang's packaging is problematic; it doesn't copy unwind.h to
259259
# the standard include directory. This should really be in our changes to
@@ -361,7 +361,7 @@ $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
361361
CC="$$(CC_$(1))" \
362362
AR="$$(AR_$(1))" \
363363
RANLIB="$$(AR_$(1)) s" \
364-
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) -fno-stack-protector" \
364+
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1)) -Wno-error -fno-stack-protector" \
365365
$(S)src/libbacktrace/configure --build=$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$(CFG_GNU_TRIPLE_$(1)))
366366
$$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \
367367
$$(BACKTRACE_BUILD_DIR_$(1))/config.h

branches/beta/mk/tests.mk

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,6 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
299299
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
300300
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
301301
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
302-
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
303-
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
304-
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
305302
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
306303
check-stage$(1)-T-$(2)-H-$(3)-rustdocck-exec \
307304
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
@@ -317,6 +314,15 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
317314
# able to build a compiler (when the target triple is in the set of host triples)
318315
ifneq ($$(findstring $(2),$$(CFG_HOST)),)
319316

317+
check-stage$(1)-T-$(2)-H-$(3)-exec: \
318+
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
319+
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
320+
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec
321+
322+
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
323+
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
324+
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-full-exec
325+
320326
check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
321327
$$(foreach crate,$$(TEST_CRATES), \
322328
check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
@@ -340,9 +346,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
340346
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
341347
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
342348
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
343-
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
344349
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
345-
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-full-exec \
346350
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
347351

348352
endef

branches/beta/src/bootstrap/bootstrap.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def download_rust_nightly(self):
7373

7474
if self.rustc().startswith(self.bin_root()) and \
7575
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
76-
shutil.rmtree(self.bin_root())
76+
if os.path.exists(self.bin_root()):
77+
shutil.rmtree(self.bin_root())
7778
filename = "rust-std-nightly-" + self.build + ".tar.gz"
7879
url = "https://static.rust-lang.org/dist/" + self.snap_rustc_date()
7980
tarball = os.path.join(rustc_cache, filename)

branches/beta/src/bootstrap/build/compile.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ pub fn std_link(build: &Build,
8383
libdir.join(staticlib("compiler-rt", target))));
8484
}
8585
add_to_sysroot(&out_dir, &libdir);
86+
87+
if target.contains("musl") && (target.contains("x86_64") || target.contains("i686")) {
88+
copy_third_party_objects(build, target, &libdir);
89+
}
90+
}
91+
92+
/// Copies the crt(1,i,n).o startup objects
93+
///
94+
/// Only required for musl targets that statically link to libc
95+
fn copy_third_party_objects(build: &Build, target: &str, into: &Path) {
96+
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
97+
t!(fs::copy(compiler_file(build.cc(target), obj), into.join(obj)));
98+
}
8699
}
87100

88101
/// Build and prepare startup objects like rsbegin.o and rsend.o

branches/beta/src/bootstrap/build/sanity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn check(build: &mut Build) {
7979
}
8080

8181
// Make sure musl-root is valid if specified
82-
if target.contains("musl") {
82+
if target.contains("musl") && (target.contains("x86_64") || target.contains("i686")) {
8383
match build.config.musl_root {
8484
Some(ref root) => {
8585
if fs::metadata(root.join("lib/libc.a")).is_err() {

branches/beta/src/doc/book/iterators.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Now that you know more Rust, we can talk in detail about how this works.
1414
Ranges (the `0..10`) are 'iterators'. An iterator is something that we can
1515
call the `.next()` method on repeatedly, and it gives us a sequence of things.
1616

17+
(By the way, a range with two dots like `0..10` is inclusive on the left (so it
18+
starts at 0) and exclusive on the right (so it ends at 9). A mathematician
19+
would write "[0, 10)". To get a range that goes all the way up to 10 you can
20+
write `0...10`.)
21+
1722
Like this:
1823

1924
```rust

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn foo() {
5151
}
5252
```
5353

54-
When `v` comes into scope, a new [vector] is created on [the stack][stack],
54+
When `v` comes into scope, a new [vector][vectors] is created on [the stack][stack],
5555
and it allocates space on [the heap][heap] for its elements. When `v` goes out
5656
of scope at the end of `foo()`, Rust will clean up everything related to the
5757
vector, even the heap-allocated memory. This happens deterministically, at the

branches/beta/src/doc/book/references-and-borrowing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Before we get to the details, two important notes about the ownership system.
2323
Rust has a focus on safety and speed. It accomplishes these goals through many
2424
‘zero-cost abstractions’, which means that in Rust, abstractions cost as little
2525
as possible in order to make them work. The ownership system is a prime example
26-
of a zero cost abstraction. All of the analysis we’ll talk about in this guide
26+
of a zero-cost abstraction. All of the analysis we’ll talk about in this guide
2727
is _done at compile time_. You do not pay any run-time cost for any of these
2828
features.
2929

branches/beta/src/doc/book/syntax-index.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,40 @@
4343
* `!` (`!expr`): bitwise or logical complement. Overloadable (`Not`).
4444
* `!=` (`var != expr`): nonequality comparison. Overloadable (`PartialEq`).
4545
* `%` (`expr % expr`): arithmetic remainder. Overloadable (`Rem`).
46-
* `%=` (`var %= expr`): arithmetic remainder & assignment.
46+
* `%=` (`var %= expr`): arithmetic remainder & assignment. Overloadable (`RemAssign`).
4747
* `&` (`expr & expr`): bitwise and. Overloadable (`BitAnd`).
4848
* `&` (`&expr`): borrow. See [References and Borrowing].
4949
* `&` (`&type`, `&mut type`, `&'a type`, `&'a mut type`): borrowed pointer type. See [References and Borrowing].
50-
* `&=` (`var &= expr`): bitwise and & assignment.
50+
* `&=` (`var &= expr`): bitwise and & assignment. Overloadable (`BitAndAssign`).
5151
* `&&` (`expr && expr`): logical and.
5252
* `*` (`expr * expr`): arithmetic multiplication. Overloadable (`Mul`).
5353
* `*` (`*expr`): dereference.
5454
* `*` (`*const type`, `*mut type`): raw pointer. See [Raw Pointers].
55-
* `*=` (`var *= expr`): arithmetic multiplication & assignment.
55+
* `*=` (`var *= expr`): arithmetic multiplication & assignment. Overloadable (`MulAssign`).
5656
* `+` (`expr + expr`): arithmetic addition. Overloadable (`Add`).
5757
* `+` (`trait + trait`, `'a + trait`): compound type constraint. See [Traits (Multiple Trait Bounds)].
58-
* `+=` (`var += expr`): arithmetic addition & assignment.
58+
* `+=` (`var += expr`): arithmetic addition & assignment. Overloadable (`AddAssign`).
5959
* `,`: argument and element separator. See [Attributes], [Functions], [Structs], [Generics], [Match], [Closures], [Crates and Modules (Importing Modules with `use`)].
6060
* `-` (`expr - expr`): arithmetic subtraction. Overloadable (`Sub`).
6161
* `-` (`- expr`): arithmetic negation. Overloadable (`Neg`).
62-
* `-=` (`var -= expr`): arithmetic subtraction & assignment.
62+
* `-=` (`var -= expr`): arithmetic subtraction & assignment. Overloadable (`SubAssign`).
6363
* `->` (`fn(…) -> type`, `|…| -> type`): function and closure return type. See [Functions], [Closures].
6464
* `-> !` (`fn(…) -> !`, `|…| -> !`): diverging function or closure. See [Diverging Functions].
6565
* `.` (`expr.ident`): member access. See [Structs], [Method Syntax].
6666
* `..` (`..`, `expr..`, `..expr`, `expr..expr`): right-exclusive range literal.
6767
* `..` (`..expr`): struct literal update syntax. See [Structs (Update syntax)].
6868
* `..` (`variant(x, ..)`, `struct_type { x, .. }`): "and the rest" pattern binding. See [Patterns (Ignoring bindings)].
69-
* `...` (`expr ... expr`): inclusive range pattern. See [Patterns (Ranges)].
69+
* `...` (`...expr`, `expr...expr`) *in an expression*: inclusive range expression. See [Iterators].
70+
* `...` (`expr...expr`) *in a pattern*: inclusive range pattern. See [Patterns (Ranges)].
7071
* `/` (`expr / expr`): arithmetic division. Overloadable (`Div`).
71-
* `/=` (`var /= expr`): arithmetic division & assignment.
72+
* `/=` (`var /= expr`): arithmetic division & assignment. Overloadable (`DivAssign`).
7273
* `:` (`pat: type`, `ident: type`): constraints. See [Variable Bindings], [Functions], [Structs], [Traits].
7374
* `:` (`ident: expr`): struct field initializer. See [Structs].
7475
* `:` (`'a: loop {…}`): loop label. See [Loops (Loops Labels)].
7576
* `;`: statement and item terminator.
7677
* `;` (`[…; len]`): part of fixed-size array syntax. See [Primitive Types (Arrays)].
7778
* `<<` (`expr << expr`): left-shift. Overloadable (`Shl`).
78-
* `<<=` (`var <<= expr`): left-shift & assignment.
79+
* `<<=` (`var <<= expr`): left-shift & assignment. Overloadable (`ShlAssign`).
7980
* `<` (`expr < expr`): less-than comparison. Overloadable (`PartialOrd`).
8081
* `<=` (`var <= expr`): less-than or equal-to comparison. Overloadable (`PartialOrd`).
8182
* `=` (`var = expr`, `ident = type`): assignment/equivalence. See [Variable Bindings], [`type` Aliases], generic parameter defaults.
@@ -84,14 +85,14 @@
8485
* `>` (`expr > expr`): greater-than comparison. Overloadable (`PartialOrd`).
8586
* `>=` (`var >= expr`): greater-than or equal-to comparison. Overloadable (`PartialOrd`).
8687
* `>>` (`expr >> expr`): right-shift. Overloadable (`Shr`).
87-
* `>>=` (`var >>= expr`): right-shift & assignment.
88+
* `>>=` (`var >>= expr`): right-shift & assignment. Overloadable (`ShrAssign`).
8889
* `@` (`ident @ pat`): pattern binding. See [Patterns (Bindings)].
8990
* `^` (`expr ^ expr`): bitwise exclusive or. Overloadable (`BitXor`).
90-
* `^=` (`var ^= expr`): bitwise exclusive or & assignment.
91+
* `^=` (`var ^= expr`): bitwise exclusive or & assignment. Overloadable (`BitXorAssign`).
9192
* `|` (`expr | expr`): bitwise or. Overloadable (`BitOr`).
9293
* `|` (`pat | pat`): pattern alternatives. See [Patterns (Multiple patterns)].
9394
* `|` (`|…| expr`): closures. See [Closures].
94-
* `|=` (`var |= expr`): bitwise or & assignment.
95+
* `|=` (`var |= expr`): bitwise or & assignment. Overloadable (`BitOrAssign`).
9596
* `||` (`expr || expr`): logical or.
9697
* `_`: "ignored" pattern binding. See [Patterns (Ignoring bindings)].
9798

@@ -205,6 +206,7 @@
205206
[Functions (Early Returns)]: functions.html#early-returns
206207
[Functions]: functions.html
207208
[Generics]: generics.html
209+
[Iterators]: iterators.html
208210
[Lifetimes]: lifetimes.html
209211
[Loops (`for`)]: loops.html#for
210212
[Loops (`loop`)]: loops.html#loop

branches/beta/src/doc/book/testing.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,3 @@ you add more examples.
515515

516516
We haven’t covered all of the details with writing documentation tests. For more,
517517
please see the [Documentation chapter](documentation.html).
518-
519-
One final note: documentation tests *cannot* be run on binary crates.
520-
To see more on file arrangement see the [Crates and
521-
Modules](crates-and-modules.html) section.

branches/beta/src/doc/book/vectors.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,36 @@ for i in v {
115115
}
116116
```
117117

118+
Note: You cannot use the vector again once you have iterated by taking ownership of the vector.
119+
You can iterate the vector multiple times by taking a reference to the vector whilst iterating.
120+
For example, the following code does not compile.
121+
122+
```rust,ignore
123+
let mut v = vec![1, 2, 3, 4, 5];
124+
125+
for i in v {
126+
println!("Take ownership of the vector and its element {}", i);
127+
}
128+
129+
for i in v {
130+
println!("Take ownership of the vector and its element {}", i);
131+
}
132+
```
133+
134+
Whereas the following works perfectly,
135+
136+
```rust
137+
let mut v = vec![1, 2, 3, 4, 5];
138+
139+
for i in &v {
140+
println!("This is a reference to {}", i);
141+
}
142+
143+
for i in &v {
144+
println!("This is a reference to {}", i);
145+
}
146+
```
147+
118148
Vectors have many more useful methods, which you can read about in [their
119149
API documentation][vec].
120150

0 commit comments

Comments
 (0)