Skip to content

Commit ab2cbba

Browse files
committed
---
yaml --- r: 227164 b: refs/heads/auto c: 138252c h: refs/heads/master v: v3
1 parent b131dd0 commit ab2cbba

File tree

462 files changed

+5545
-5803
lines changed

Some content is hidden

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

462 files changed

+5545
-5803
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: f1ae605db8944f874994bab2879819f86f0250e2
11+
refs/heads/auto: 138252cc6a59420144b261a6537dcc2d95551981
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Libraries
7979
are used by code generators to emit implementations of [`Debug`].
8080
* `str` has new [`to_uppercase`][strup] and [`to_lowercase`][strlow]
8181
methods that convert case, following Unicode case mapping.
82-
* It is now easier to handle poisoned locks. The [`PoisonError`]
82+
* It is now easier to handle to poisoned locks. The [`PoisonError`]
8383
type, returned by failing lock operations, exposes `into_inner`,
8484
`get_ref`, and `get_mut`, which all give access to the inner lock
8585
guard, and allow the poisoned lock to continue to operate. The

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/docs.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ 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 nomicon style error-index
80+
DOC_TARGETS := trpl tarpl style error-index
8181
COMPILER_DOC_TARGETS :=
8282
DOC_L10N_TARGETS :=
8383

@@ -287,12 +287,12 @@ doc/book/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/trpl/*.md) | doc/
287287
$(Q)rm -rf doc/book
288288
$(Q)$(RUSTBOOK) build $(S)src/doc/trpl doc/book
289289

290-
nomicon: doc/nomicon/index.html
290+
tarpl: doc/adv-book/index.html
291291

292-
doc/nomicon/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/nomicon/*.md) | doc/
292+
doc/adv-book/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/tarpl/*.md) | doc/
293293
@$(call E, rustbook: $@)
294-
$(Q)rm -rf doc/nomicon
295-
$(Q)$(RUSTBOOK) build $(S)src/doc/nomicon doc/nomicon
294+
$(Q)rm -rf doc/adv-book
295+
$(Q)$(RUSTBOOK) build $(S)src/doc/tarpl doc/adv-book
296296

297297
style: doc/style/index.html
298298

branches/auto/mk/main.mk

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.4.0
16+
CFG_RELEASE_NUM=1.3.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
@@ -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: 7 additions & 8 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,6 +243,9 @@ $(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.
246+
#
247+
# FIXME(stage0): remove this and all other relevant support in the makefiles
248+
# after a snapshot is made
245249
define ADD_LLVM_AR_TO_MSVC_DEPS
246250
ifeq ($$(findstring msvc,$(1)),msvc)
247251
NATIVE_TOOL_DEPS_core_T_$(1) += llvm-ar.exe
@@ -277,15 +281,10 @@ $(foreach target,$(CFG_TARGET), \
277281
# Fun times!
278282
#
279283
# [1]: https://msdn.microsoft.com/en-us/library/28d6s79h.aspx
280-
#
281-
# FIXME(stage0): remove this macro and the usage below (and the commments above)
282-
# when a new snapshot is available. Also remove the
283-
# RUSTFLAGS$(1)_.._T_ variable in mk/target.mk along with
284-
# CUSTOM_DEPS (as they were only added for this)
285284
define ADD_RUSTC_LLVM_DEF_TO_MSVC
286285
ifeq ($$(findstring msvc,$(1)),msvc)
287-
RUSTFLAGS0_rustc_llvm_T_$(1) += -C link-args="-DEF:$(1)/rt/rustc_llvm.def"
288-
CUSTOM_DEPS0_rustc_llvm_T_$(1) += $(1)/rt/rustc_llvm.def
286+
RUSTFLAGS_rustc_llvm_T_$(1) += -C link-args="-DEF:$(1)/rt/rustc_llvm.def"
287+
CUSTOM_DEPS_rustc_llvm_T_$(1) += $(1)/rt/rustc_llvm.def
289288

290289
$(1)/rt/rustc_llvm.def: $$(S)src/etc/mklldef.py $$(S)src/librustc_llvm/lib.rs
291290
$$(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: 10 additions & 3 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,6 +206,9 @@ $(foreach host,$(CFG_HOST), \
205206
# $(3) - triple snapshot is built for
206207
# $(4) - crate
207208
# $(5) - tool
209+
#
210+
# FIXME(stage0): remove this and all other relevant support in the makefiles
211+
# after a snapshot is made
208212
define MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR
209213
ifneq (,$(3))
210214
$$(TLIB$(1)_T_$(2)_H_$(2))/stamp.$(4): $$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5)
@@ -229,6 +233,9 @@ $(foreach target,$(CFG_TARGET), \
229233
# path instead of MinGW's /usr/bin/link.exe (entirely unrelated)
230234
#
231235
# The values for these variables are detected by the configure script.
236+
#
237+
# FIXME(stage0): remove this and all other relevant support in the makefiles
238+
# after a snapshot is made
232239
define SETUP_LIB_MSVC_ENV_VARS
233240
ifeq ($$(findstring msvc,$(2)),msvc)
234241
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \

branches/auto/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ $(foreach doc,$(DOCS), \
162162
$(eval $(call DOCTEST,md-$(doc),$(S)src/doc/$(doc).md)))
163163
$(foreach file,$(wildcard $(S)src/doc/trpl/*.md), \
164164
$(eval $(call DOCTEST,$(file:$(S)src/doc/trpl/%.md=trpl-%),$(file))))
165-
$(foreach file,$(wildcard $(S)src/doc/nomicon/*.md), \
166-
$(eval $(call DOCTEST,$(file:$(S)src/doc/nomicon/%.md=nomicon-%),$(file))))
165+
$(foreach file,$(wildcard $(S)src/doc/tarpl/*.md), \
166+
$(eval $(call DOCTEST,$(file:$(S)src/doc/tarpl/%.md=tarpl-%),$(file))))
167167
######################################################################
168168
# Main test targets
169169
######################################################################

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/README.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

branches/auto/src/doc/reference.md

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,8 @@ balanced, but they are otherwise not special.
538538
In the matcher, `$` _name_ `:` _designator_ matches the nonterminal in the Rust
539539
syntax named by _designator_. Valid designators are `item`, `block`, `stmt`,
540540
`pat`, `expr`, `ty` (type), `ident`, `path`, `tt` (either side of the `=>`
541-
in macro rules), and `meta` (contents of an attribute). In the transcriber, the
542-
designator is already known, and so only the name of a matched nonterminal comes
543-
after the dollar sign.
541+
in macro rules). In the transcriber, the designator is already known, and so
542+
only the name of a matched nonterminal comes after the dollar sign.
544543

545544
In both the matcher and transcriber, the Kleene star-like operator indicates
546545
repetition. The Kleene star operator consists of `$` and parentheses, optionally
@@ -1501,29 +1500,7 @@ have an implementation for `Shape`. Multiple supertraits are separated by `+`,
15011500
`trait Circle : Shape + PartialEq { }`. In an implementation of `Circle` for a
15021501
given type `T`, methods can refer to `Shape` methods, since the typechecker
15031502
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-
```
1503+
implementation of `Shape`.
15271504

15281505
In type-parameterized functions, methods of the supertrait may be called on
15291506
values of subtrait-bound type parameters. Referring to the previous example of
@@ -1924,16 +1901,10 @@ On an `extern` block, the following attributes are interpreted:
19241901
name and type. This is feature gated and the exact behavior is
19251902
implementation-defined (due to variety of linker invocation syntax).
19261903
- `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
1904+
declarations in this block to be linked correctly. `link` supports an optional `kind`
1905+
key with three possible values: `dylib`, `static`, and `framework`. See [external blocks](#external-blocks) for more about external blocks. Two
19301906
examples: `#[link(name = "readline")]` and
19311907
`#[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.
19371908

19381909
On declarations inside an `extern` block, the following attributes are
19391910
interpreted:

branches/auto/src/doc/tarpl/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
% The Advanced Rust Programming Language
2+
3+
# NOTE: This is a draft document, and may contain serious errors
4+
5+
So you've played around with Rust a bit. You've written a few simple programs
6+
and you think you grok the basics. Maybe you've even read through *[The Rust
7+
Programming Language][trpl]* (TRPL). Now you want to get neck-deep in all the
8+
nitty-gritty details of the language. You want to know those weird corner-cases.
9+
You want to know what the heck `unsafe` really means, and how to properly use
10+
it. This is the book for you.
11+
12+
To be clear, this book goes into serious detail. We're going to dig into
13+
exception-safety and pointer aliasing. We're going to talk about memory
14+
models. We're even going to do some type-theory. This is stuff that you
15+
absolutely don't need to know to write fast and safe Rust programs.
16+
You could probably close this book *right now* and still have a productive
17+
and happy career in Rust.
18+
19+
However if you intend to write unsafe code -- or just really want to dig into
20+
the guts of the language -- this book contains invaluable information.
21+
22+
Unlike TRPL we will be assuming considerable prior knowledge. In particular, you
23+
should be comfortable with basic systems programming and basic Rust. If you
24+
don't feel comfortable with these topics, you should consider [reading
25+
TRPL][trpl], though we will not be assuming that you have. You can skip
26+
straight to this book if you want; just know that we won't be explaining
27+
everything from the ground up.
28+
29+
Due to the nature of advanced Rust programming, we will be spending a lot of
30+
time talking about *safety* and *guarantees*. In particular, a significant
31+
portion of the book will be dedicated to correctly writing and understanding
32+
Unsafe Rust.
33+
34+
[trpl]: ../book/

branches/auto/src/doc/nomicon/atomics.md renamed to branches/auto/src/doc/tarpl/atomics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fundamentally unsynchronized and compilers are free to aggressively optimize
127127
them. In particular, data accesses are free to be reordered by the compiler on
128128
the assumption that the program is single-threaded. The hardware is also free to
129129
propagate the changes made in data accesses to other threads as lazily and
130-
inconsistently as it wants. Most critically, data accesses are how data races
130+
inconsistently as it wants. Mostly critically, data accesses are how data races
131131
happen. Data accesses are very friendly to the hardware and compiler, but as
132132
we've seen they offer *awful* semantics to try to write synchronized code with.
133133
Actually, that's too weak.

branches/auto/src/doc/nomicon/concurrency.md renamed to branches/auto/src/doc/tarpl/concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ an abstraction over them in a relatively uncontroversial way. Message passing,
77
green threads, and async APIs are all diverse enough that any abstraction over
88
them tends to involve trade-offs that we weren't willing to commit to for 1.0.
99

10-
However the way Rust models concurrency makes it relatively easy to design your own
10+
However the way Rust models concurrency makes it relatively easy design your own
1111
concurrency paradigm as a library and have everyone else's code Just Work
1212
with yours. Just require the right lifetimes and Send and Sync where appropriate
1313
and you're off to the races. Or rather, off to the... not... having... races.

branches/auto/src/doc/nomicon/destructors.md renamed to branches/auto/src/doc/tarpl/destructors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ enum Link {
120120
will have its inner Box field dropped if and only if an instance stores the
121121
Next variant.
122122

123-
In general this works really nicely because you don't need to worry about
123+
In general this works really nice because you don't need to worry about
124124
adding/removing drops when you refactor your data layout. Still there's
125125
certainly many valid usecases for needing to do trickier things with
126126
destructors.

branches/auto/src/doc/nomicon/drop-flags.md renamed to branches/auto/src/doc/tarpl/drop-flags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Drop Flags
22

33
The examples in the previous section introduce an interesting problem for Rust.
4-
We have seen that it's possible to conditionally initialize, deinitialize, and
4+
We have seen that's possible to conditionally initialize, deinitialize, and
55
reinitialize locations of memory totally safely. For Copy types, this isn't
66
particularly notable since they're just a random pile of bits. However types
77
with destructors are a different story: Rust needs to know whether to call a

0 commit comments

Comments
 (0)