Skip to content

Commit 31773b8

Browse files
committed
---
yaml --- r: 227166 b: refs/heads/auto c: 8c4dc18 h: refs/heads/master v: v3
1 parent 7bcf420 commit 31773b8

File tree

258 files changed

+4762
-4094
lines changed

Some content is hidden

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

258 files changed

+4762
-4094
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 23f43896ce92830173e503eab8b2f7fba8137e37
11+
refs/heads/auto: 8c4dc18d2a51321070abccd34182381bdc66054d
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/mk/clean.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ define CLEAN_TARGET_STAGE_N
101101
clean$(1)_T_$(2)_H_$(3): \
102102
$$(foreach crate,$$(CRATES),clean$(1)_T_$(2)_H_$(3)-lib-$$(crate)) \
103103
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS_ALL),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool))
104+
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
104105
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a
105106
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass_stage* # For unix
106107
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/run_pass_stage* # For windows

branches/auto/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ DEPS_libc := core
6565
DEPS_rustc_unicode := core
6666
DEPS_alloc := core libc native:jemalloc
6767
DEPS_std := core libc rand alloc collections rustc_unicode \
68-
native:rust_builtin native:backtrace \
68+
native:rust_builtin native:backtrace native:rustrt_native \
6969
rustc_bitflags
7070
DEPS_graphviz := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc

branches/auto/mk/main.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ endif
163163
# that the snapshot will be generated with a statically linked rustc so we only
164164
# have to worry about the distribution of one file (with its native dynamic
165165
# dependencies)
166-
RUSTFLAGS_STAGE0 += -C prefer-dynamic -C no-stack-check
166+
RUSTFLAGS_STAGE0 += -C prefer-dynamic
167167
RUSTFLAGS_STAGE1 += -C prefer-dynamic
168168
RUST_LIB_FLAGS_ST2 += -C prefer-dynamic
169169
RUST_LIB_FLAGS_ST3 += -C prefer-dynamic
@@ -400,11 +400,6 @@ TSREQ$(1)_T_$(2)_H_$(3) = \
400400
$$(foreach obj,$$(INSTALLED_OBJECTS_$(2)),\
401401
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj))
402402

403-
ifeq ($(1),0)
404-
TSREQ$(1)_T_$(2)_H_$(3) += \
405-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(call CFG_STATIC_LIB_NAME_$(2),morestack)
406-
endif
407-
408403
# Prerequisites for a working stageN compiler and libraries, for a specific
409404
# target
410405
SREQ$(1)_T_$(2)_H_$(3) = \

branches/auto/mk/platform.mk

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ CFG_RLIB_GLOB=lib$(1)-*.rlib
113113
include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk)
114114

115115
define ADD_INSTALLED_OBJECTS
116-
INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
116+
INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),morestack) \
117+
$$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
117118
endef
118119

119120
$(foreach target,$(CFG_TARGET), \
@@ -242,9 +243,6 @@ $(foreach target,$(CFG_TARGET), \
242243
# Windows MSVC in the compiler, but the gist of it is that we use `llvm-ar.exe`
243244
# instead of `lib.exe` for assembling archives, so we need to inject this custom
244245
# dependency here.
245-
#
246-
# FIXME(stage0): remove this and all other relevant support in the makefiles
247-
# after a snapshot is made
248246
define ADD_LLVM_AR_TO_MSVC_DEPS
249247
ifeq ($$(findstring msvc,$(1)),msvc)
250248
NATIVE_TOOL_DEPS_core_T_$(1) += llvm-ar.exe
@@ -280,15 +278,10 @@ $(foreach target,$(CFG_TARGET), \
280278
# Fun times!
281279
#
282280
# [1]: https://msdn.microsoft.com/en-us/library/28d6s79h.aspx
283-
#
284-
# FIXME(stage0): remove this macro and the usage below (and the commments above)
285-
# when a new snapshot is available. Also remove the
286-
# RUSTFLAGS$(1)_.._T_ variable in mk/target.mk along with
287-
# CUSTOM_DEPS (as they were only added for this)
288281
define ADD_RUSTC_LLVM_DEF_TO_MSVC
289282
ifeq ($$(findstring msvc,$(1)),msvc)
290-
RUSTFLAGS0_rustc_llvm_T_$(1) += -C link-args="-DEF:$(1)/rt/rustc_llvm.def"
291-
CUSTOM_DEPS0_rustc_llvm_T_$(1) += $(1)/rt/rustc_llvm.def
283+
RUSTFLAGS_rustc_llvm_T_$(1) += -C link-args="-DEF:$(1)/rt/rustc_llvm.def"
284+
CUSTOM_DEPS_rustc_llvm_T_$(1) += $(1)/rt/rustc_llvm.def
292285

293286
$(1)/rt/rustc_llvm.def: $$(S)src/etc/mklldef.py $$(S)src/librustc_llvm/lib.rs
294287
$$(CFG_PYTHON) $$^ $$@ rustc_llvm-$$(CFG_FILENAME_EXTRA)

branches/auto/mk/rt.mk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rust_builtin hoedown miniz \
39-
rust_test_helpers morestack
38+
NATIVE_LIBS := rust_builtin hoedown morestack miniz \
39+
rustrt_native rust_test_helpers
4040

4141
# $(1) is the target triple
4242
define NATIVE_LIBRARIES
@@ -53,8 +53,10 @@ NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
5353
NATIVE_DEPS_miniz_$(1) = miniz.c
5454
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
5555
rust_android_dummy.c
56+
NATIVE_DEPS_rustrt_native_$(1) := arch/$$(HOST_$(1))/record_sp.S
5657
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
57-
NATIVE_DEPS_morestack_$(1) := empty.c
58+
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
59+
5860

5961
################################################################################
6062
# You shouldn't find it that necessary to edit anything below this line.

branches/auto/mk/target.mk

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4) := \
4040
$$(RT_OUTPUT_DIR_$(2))/$$(dep)) \
4141
$$(foreach dep,$$(NATIVE_TOOL_DEPS_$(4)_T_$(2)), \
4242
$$(TBIN$(1)_T_$(3)_H_$(3))/$$(dep)) \
43-
$$(CUSTOM_DEPS$(1)_$(4)_T_$(2))
43+
$$(CUSTOM_DEPS_$(4)_T_$(2))
4444
endef
4545

4646
$(foreach host,$(CFG_HOST), \
@@ -56,7 +56,8 @@ $(foreach host,$(CFG_HOST), \
5656
# 1. The immediate dependencies are the rust source files
5757
# 2. Each rust crate dependency is listed (based on their stamp files),
5858
# as well as all native dependencies (listed in RT_OUTPUT_DIR)
59-
# 3. The stage (n-1) compiler is required through the TSREQ dependency
59+
# 3. The stage (n-1) compiler is required through the TSREQ dependency, along
60+
# with the morestack library
6061
# 4. When actually executing the rule, the first thing we do is to clean out
6162
# old libs and rlibs via the REMOVE_ALL_OLD_GLOB_MATCHES macro
6263
# 5. Finally, we get around to building the actual crate. It's just one
@@ -92,7 +93,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
9293
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
9394
$$(LLVM_STDCPP_RUSTFLAGS_$(2)) \
9495
$$(RUSTFLAGS_$(4)) \
95-
$$(RUSTFLAGS$(1)_$(4)_T_$(2)) \
96+
$$(RUSTFLAGS_$(4)_T_$(2)) \
9697
--out-dir $$(@D) \
9798
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
9899
$$<
@@ -205,9 +206,6 @@ $(foreach host,$(CFG_HOST), \
205206
# $(3) - triple snapshot is built for
206207
# $(4) - crate
207208
# $(5) - tool
208-
#
209-
# FIXME(stage0): remove this and all other relevant support in the makefiles
210-
# after a snapshot is made
211209
define MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR
212210
ifneq (,$(3))
213211
$$(TLIB$(1)_T_$(2)_H_$(2))/stamp.$(4): $$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5)
@@ -232,9 +230,6 @@ $(foreach target,$(CFG_TARGET), \
232230
# path instead of MinGW's /usr/bin/link.exe (entirely unrelated)
233231
#
234232
# The values for these variables are detected by the configure script.
235-
#
236-
# FIXME(stage0): remove this and all other relevant support in the makefiles
237-
# after a snapshot is made
238233
define SETUP_LIB_MSVC_ENV_VARS
239234
ifeq ($$(findstring msvc,$(2)),msvc)
240235
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \

branches/auto/src/compiletest/procsrv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
2626
// Add the new dylib search path var
2727
let var = DynamicLibrary::envvar();
2828
let newpath = DynamicLibrary::create_path(&path);
29-
cmd.env(var, newpath);
29+
let newpath = newpath.to_str().unwrap().to_string();
30+
cmd.env(var, &newpath);
3031
}
3132

3233
pub struct Result {pub status: ExitStatus, pub out: String, pub err: String}

branches/auto/src/doc/nomicon/exotic-sizes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ support values.
8585
Safe code need not worry about ZSTs, but *unsafe* code must be careful about the
8686
consequence of types with no size. In particular, pointer offsets are no-ops,
8787
and standard allocators (including jemalloc, the one used by default in Rust)
88-
may return `nullptr` when a zero-sized allocation is requested, which is
89-
indistinguishable from out of memory.
88+
generally consider passing in `0` for the size of an allocation as Undefined
89+
Behaviour.
9090

9191

9292

branches/auto/src/doc/nomicon/lifetimes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ likely desugar to the following:
5252
}
5353
```
5454

55-
Wow. That's... awful. Let's all take a moment to thank Rust for making this easier.
55+
Wow. That's... awful. Let's all take a moment to thank Rust for being a
56+
diabetes-inducing torrent of syrupy-goodness.
5657

5758
Actually passing references to outer scopes will cause Rust to infer
5859
a larger lifetime:

branches/auto/src/doc/nomicon/repr-rust.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ struct A {
3636
}
3737
```
3838

39-
will be 32-bit aligned on an architecture that aligns these primitives to their
40-
respective sizes. The whole struct will therefore have a size that is a multiple
41-
of 32-bits. It will potentially become:
39+
will be 32-bit aligned assuming these primitives are aligned to their size.
40+
It will therefore have a size that is a multiple of 32-bits. It will potentially
41+
*really* become:
4242

4343
```rust
4444
struct A {
@@ -50,10 +50,10 @@ struct A {
5050
}
5151
```
5252

53-
There is *no indirection* for these types; all data is stored within the struct,
54-
as you would expect in C. However with the exception of arrays (which are
55-
densely packed and in-order), the layout of data is not by default specified in
56-
Rust. Given the two following struct definitions:
53+
There is *no indirection* for these types; all data is stored contiguously as
54+
you would expect in C. However with the exception of arrays (which are densely
55+
packed and in-order), the layout of data is not by default specified in Rust.
56+
Given the two following struct definitions:
5757

5858
```rust
5959
struct A {
@@ -62,17 +62,18 @@ struct A {
6262
}
6363

6464
struct B {
65-
a: i32,
65+
x: i32,
6666
b: u64,
6767
}
6868
```
6969

7070
Rust *does* guarantee that two instances of A have their data laid out in
71-
exactly the same way. However Rust *does not* currently guarantee that an
72-
instance of A has the same field ordering or padding as an instance of B, though
73-
in practice there's no reason why they wouldn't.
71+
exactly the same way. However Rust *does not* guarantee that an instance of A
72+
has the same field ordering or padding as an instance of B (in practice there's
73+
no particular reason why they wouldn't, other than that its not currently
74+
guaranteed).
7475

75-
With A and B as written, this point would seem to be pedantic, but several other
76+
With A and B as written, this is basically nonsensical, but several other
7677
features of Rust make it desirable for the language to play with data layout in
7778
complex ways.
7879

@@ -132,21 +133,18 @@ struct FooRepr {
132133
}
133134
```
134135

135-
And indeed this is approximately how it would be laid out in general (modulo the
136-
size and position of `tag`).
137-
138-
However there are several cases where such a representation is inefficient. The
139-
classic case of this is Rust's "null pointer optimization": an enum consisting
140-
of a single outer unit variant (e.g. `None`) and a (potentially nested) non-
141-
nullable pointer variant (e.g. `&T`) makes the tag unnecessary, because a null
142-
pointer value can safely be interpreted to mean that the unit variant is chosen
143-
instead. The net result is that, for example, `size_of::<Option<&T>>() ==
144-
size_of::<&T>()`.
136+
And indeed this is approximately how it would be laid out in general
137+
(modulo the size and position of `tag`). However there are several cases where
138+
such a representation is inefficient. The classic case of this is Rust's
139+
"null pointer optimization". Given a pointer that is known to not be null
140+
(e.g. `&u32`), an enum can *store* a discriminant bit *inside* the pointer
141+
by using null as a special value. The net result is that
142+
`size_of::<Option<&T>>() == size_of::<&T>()`
145143

146-
There are many types in Rust that are, or contain, non-nullable pointers such as
144+
There are many types in Rust that are, or contain, "not null" pointers such as
147145
`Box<T>`, `Vec<T>`, `String`, `&T`, and `&mut T`. Similarly, one can imagine
148146
nested enums pooling their tags into a single discriminant, as they are by
149-
definition known to have a limited range of valid values. In principle enums could
147+
definition known to have a limited range of valid values. In principle enums can
150148
use fairly elaborate algorithms to cache bits throughout nested types with
151149
special constrained representations. As such it is *especially* desirable that
152150
we leave enum layout unspecified today.

branches/auto/src/doc/reference.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,29 +1501,7 @@ have an implementation for `Shape`. Multiple supertraits are separated by `+`,
15011501
`trait Circle : Shape + PartialEq { }`. In an implementation of `Circle` for a
15021502
given type `T`, methods can refer to `Shape` methods, since the typechecker
15031503
checks that any type with an implementation of `Circle` also has an
1504-
implementation of `Shape`:
1505-
1506-
```rust
1507-
struct Foo;
1508-
1509-
trait Shape { fn area(&self) -> f64; }
1510-
trait Circle : Shape { fn radius(&self) -> f64; }
1511-
# impl Shape for Foo {
1512-
# fn area(&self) -> f64 {
1513-
# 0.0
1514-
# }
1515-
# }
1516-
impl Circle for Foo {
1517-
fn radius(&self) -> f64 {
1518-
println!("calling area: {}", self.area());
1519-
1520-
0.0
1521-
}
1522-
}
1523-
1524-
let c = Foo;
1525-
c.radius();
1526-
```
1504+
implementation of `Shape`.
15271505

15281506
In type-parameterized functions, methods of the supertrait may be called on
15291507
values of subtrait-bound type parameters. Referring to the previous example of
@@ -1924,16 +1902,10 @@ On an `extern` block, the following attributes are interpreted:
19241902
name and type. This is feature gated and the exact behavior is
19251903
implementation-defined (due to variety of linker invocation syntax).
19261904
- `link` - indicate that a native library should be linked to for the
1927-
declarations in this block to be linked correctly. `link` supports an optional
1928-
`kind` key with three possible values: `dylib`, `static`, and `framework`. See
1929-
[external blocks](#external-blocks) for more about external blocks. Two
1905+
declarations in this block to be linked correctly. `link` supports an optional `kind`
1906+
key with three possible values: `dylib`, `static`, and `framework`. See [external blocks](#external-blocks) for more about external blocks. Two
19301907
examples: `#[link(name = "readline")]` and
19311908
`#[link(name = "CoreFoundation", kind = "framework")]`.
1932-
- `linked_from` - indicates what native library this block of FFI items is
1933-
coming from. This attribute is of the form `#[linked_from = "foo"]` where
1934-
`foo` is the name of a library in either `#[link]` or a `-l` flag. This
1935-
attribute is currently required to export symbols from a Rust dynamic library
1936-
on Windows, and it is feature gated behind the `linked_from` feature.
19371909

19381910
On declarations inside an `extern` block, the following attributes are
19391911
interpreted:

branches/auto/src/doc/trpl/advanced-linking.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ Static linking refers to the process of creating output that contain all
3838
required libraries and so don't need libraries installed on every system where
3939
you want to use your compiled project. Pure-Rust dependencies are statically
4040
linked by default so you can use created binaries and libraries without
41-
installing Rust everywhere. By contrast, native libraries
42-
(e.g. `libc` and `libm`) are usually dynamically linked, but it is possible to
41+
installing the Rust everywhere. By contrast, native libraries
42+
(e.g. `libc` and `libm`) usually dynamically linked, but it is possible to
4343
change this and statically link them as well.
4444

45-
Linking is a very platform-dependent topic, and static linking may not even be
46-
possible on some platforms! This section assumes some basic familiarity with
45+
Linking is a very platform dependent topic — on some platforms, static linking
46+
may not be possible at all! This section assumes some basic familiarity with
4747
linking on your platform of choice.
4848

4949
## Linux
@@ -71,7 +71,8 @@ Dynamic linking on Linux can be undesirable if you wish to use new library
7171
features on old systems or target systems which do not have the required
7272
dependencies for your program to run.
7373

74-
Static linking is supported via an alternative `libc`, `musl`. You can compile
74+
Static linking is supported via an alternative `libc`, `musl` - this must be
75+
enabled at Rust compile-time with some prerequisites available. You can compile
7576
your own version of Rust with `musl` enabled and install it into a custom
7677
directory with the instructions below:
7778

@@ -122,7 +123,7 @@ $ du -h musldist/bin/rustc
122123
```
123124

124125
You now have a build of a `musl`-enabled Rust! Because we've installed it to a
125-
custom prefix we need to make sure our system can find the binaries and appropriate
126+
custom prefix we need to make sure our system can the binaries and appropriate
126127
libraries when we try and run it:
127128

128129
```text

branches/auto/src/doc/trpl/closures.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -316,35 +316,6 @@ assert_eq!(3, answer);
316316
Now we take a trait object, a `&Fn`. And we have to make a reference
317317
to our closure when we pass it to `call_with_one`, so we use `&||`.
318318

319-
# Function pointers and closures
320-
321-
A function pointer is kind of like a closure that has no environment. As such,
322-
you can pass a function pointer to any function expecting a closure argument,
323-
and it will work:
324-
325-
```rust
326-
fn call_with_one(some_closure: &Fn(i32) -> i32) -> i32 {
327-
some_closure(1)
328-
}
329-
330-
fn add_one(i: i32) -> i32 {
331-
i + 1
332-
}
333-
334-
let f = add_one;
335-
336-
let answer = call_with_one(&f);
337-
338-
assert_eq!(2, answer);
339-
```
340-
341-
In this example, we don’t strictly need the intermediate variable `f`,
342-
the name of the function works just fine too:
343-
344-
```ignore
345-
let answer = call_with_one(&add_one);
346-
```
347-
348319
# Returning closures
349320

350321
It’s very common for functional-style code to return closures in various

0 commit comments

Comments
 (0)