Skip to content

Commit 6ef7af3

Browse files
committed
---
yaml --- r: 219047 b: refs/heads/snap-stage3 c: 0e4a361 h: refs/heads/master i: 219045: 63fcde6 219043: 7de9d44 219039: a03ad99 v: v3
1 parent fd9b909 commit 6ef7af3

File tree

176 files changed

+3129
-1603
lines changed

Some content is hidden

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

176 files changed

+3129
-1603
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: c044791d80ea0dc5c4b57b6030a67b69f8510239
3-
refs/heads/snap-stage3: ee4b58c7925a914abac8ebc7a0fc0be0cb6cb0c7
3+
refs/heads/snap-stage3: 0e4a361619e7d8e0e597db0be676a950e666f03c
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Hajime Morrita <[email protected]>
338338
Hanno Braun <[email protected]>
339339
Harry Marr <[email protected]>
340340
341-
Heejong Ahn <[email protected]
341+
Heejong Ahn <[email protected]>
342342
Henrik Schopmans <[email protected]>
343343
Herman J. Radtke III <[email protected]>
344344
HeroesGrave <[email protected]>

branches/snap-stage3/configure

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ opt rpath 0 "build rpaths into rustc itself"
565565
# This is used by the automation to produce single-target nightlies
566566
opt dist-host-only 0 "only install bins for the host architecture"
567567
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
568-
opt llvm-version-check 1 "don't check if the LLVM version is supported, build anyway"
568+
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
569569

570570
# Optimization and debugging options. These may be overridden by the release channel, etc.
571571
opt_nosave optimize 1 "build optimized rust code"
@@ -582,6 +582,7 @@ valopt sysconfdir "/etc" "install system configuration files"
582582
valopt datadir "${CFG_PREFIX}/share" "install data"
583583
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
584584
valopt llvm-root "" "set LLVM root"
585+
valopt python "" "set path to python"
585586
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
586587
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
587588
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path"
@@ -593,6 +594,7 @@ valopt musl-root "/usr/local" "MUSL root installation directory"
593594
opt_nosave manage-submodules 1 "let the build manage the git submodules"
594595
opt_nosave clang 0 "prefer clang to gcc for building the runtime"
595596
opt_nosave jemalloc 1 "build liballoc with jemalloc"
597+
opt elf-tls 1 "elf thread local storage on platforms where supported"
596598

597599
valopt_nosave prefix "/usr/local" "set installation prefix"
598600
valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
@@ -694,7 +696,9 @@ putvar CFG_BOOTSTRAP_KEY
694696
step_msg "looking for build programs"
695697

696698
probe_need CFG_CURLORWGET curl wget
697-
probe_need CFG_PYTHON python2.7 python2.6 python2 python
699+
if [ -z "$CFG_PYTHON_PROVIDED" ]; then
700+
probe_need CFG_PYTHON python2.7 python2.6 python2 python
701+
fi
698702

699703
python_version=$($CFG_PYTHON -V 2>&1)
700704
if [ $(echo $python_version | grep -c '^Python 2\.[4567]') -ne 1 ]; then
@@ -848,13 +852,6 @@ then
848852
putvar CFG_LOCAL_RUST_ROOT
849853
fi
850854

851-
# Force freebsd to build with clang; gcc doesn't like us there
852-
if [ $CFG_OSTYPE = unknown-freebsd ]
853-
then
854-
step_msg "on FreeBSD, forcing use of clang"
855-
CFG_ENABLE_CLANG=1
856-
fi
857-
858855
# Force bitrig to build with clang; gcc doesn't like us there
859856
if [ $CFG_OSTYPE = unknown-bitrig ]
860857
then
@@ -972,8 +969,8 @@ fi
972969

973970
if [ ! -z "$CFG_ENABLE_CLANG" ]
974971
then
975-
if [ -z "$CC" ] || [[ $CC == *clang ]]
976-
then
972+
case "$CC" in
973+
(''|*clang)
977974
CFG_CLANG_VERSION=$($CFG_CC \
978975
--version \
979976
| grep version \
@@ -993,9 +990,11 @@ then
993990
err "bad CLANG version: $CFG_CLANG_VERSION, need >=3.0svn"
994991
;;
995992
esac
996-
else
993+
;;
994+
(*)
997995
msg "skipping CFG_ENABLE_CLANG version check; provided CC=$CC"
998-
fi
996+
;;
997+
esac
999998
fi
1000999

10011000
if [ ! -z "$CFG_ENABLE_CCACHE" ]
@@ -1308,6 +1307,12 @@ CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm/
13081307
for t in $CFG_HOST
13091308
do
13101309
do_reconfigure=1
1310+
is_msvc=0
1311+
case "$t" in
1312+
(*-msvc)
1313+
is_msvc=1
1314+
;;
1315+
esac
13111316

13121317
if [ -z $CFG_LLVM_ROOT ]
13131318
then
@@ -1327,7 +1332,13 @@ do
13271332
LLVM_ASSERTION_OPTS="--disable-assertions"
13281333
else
13291334
LLVM_ASSERTION_OPTS="--enable-assertions"
1330-
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
1335+
1336+
# Apparently even if we request assertions be enabled for MSVC,
1337+
# LLVM's CMake build system ignore this and outputs in `Release`
1338+
# anyway.
1339+
if [ ${is_msvc} -eq 0 ]; then
1340+
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
1341+
fi
13311342
fi
13321343
else
13331344
msg "not reconfiguring LLVM, external LLVM root"
@@ -1357,14 +1368,7 @@ do
13571368
done
13581369
fi
13591370

1360-
use_cmake=0
1361-
case "$t" in
1362-
(*-msvc)
1363-
use_cmake=1
1364-
;;
1365-
esac
1366-
1367-
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -ne 0 ]
1371+
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ]
13681372
then
13691373
msg "configuring LLVM for $t with cmake"
13701374

@@ -1389,7 +1393,7 @@ do
13891393
need_ok "LLVM cmake configure failed"
13901394
fi
13911395

1392-
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -eq 0 ]
1396+
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -eq 0 ]
13931397
then
13941398
# LLVM's configure doesn't recognize the new Windows triples yet
13951399
gnu_t=$(to_gnu_triple $t)

branches/snap-stage3/mk/cfg/x86_64-pc-windows-msvc.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,8 @@ CUSTOM_DEPS_rustc_llvm_T_x86_64-pc-windows-msvc += \
8080
x86_64-pc-windows-msvc/rt/rustc_llvm.def: $(S)src/etc/mklldef.py \
8181
$(S)src/librustc_llvm/lib.rs
8282
$(CFG_PYTHON) $^ $@ rustc_llvm-$(CFG_FILENAME_EXTRA)
83+
84+
# All windows nightiles are currently a GNU triple, so this MSVC triple is not
85+
# bootstrapping from itself. This is relevant during stage0, and other parts of
86+
# the build system take this into account.
87+
BOOTSTRAP_FROM_x86_64-pc-windows-msvc := x86_64-pc-windows-gnu

branches/snap-stage3/mk/crates.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,7 @@ TOOL_INPUTS_$(1) := $$(call rwildcard,$$(dir $$(TOOL_SOURCE_$(1))),*.rs)
150150
endef
151151

152152
$(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))
153+
154+
ifdef CFG_DISABLE_ELF_TLS
155+
RUSTFLAGS_std := --cfg no_elf_tls
156+
endif

branches/snap-stage3/mk/debuggers.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
## GDB ##
1717
DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB=gdb_load_rust_pretty_printers.py \
18-
gdb_rust_pretty_printing.py
18+
gdb_rust_pretty_printing.py \
19+
debugger_pretty_printers_common.py
1920
DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS=\
2021
$(foreach script,$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB), \
2122
$(CFG_SRC_DIR)src/etc/$(script))
@@ -27,7 +28,8 @@ DEBUGGER_BIN_SCRIPTS_GDB_ABS=\
2728

2829

2930
## LLDB ##
30-
DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB=lldb_rust_formatters.py
31+
DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB=lldb_rust_formatters.py \
32+
debugger_pretty_printers_common.py
3133
DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS=\
3234
$(foreach script,$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB), \
3335
$(CFG_SRC_DIR)src/etc/$(script))

branches/snap-stage3/mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ endef
265265
$(foreach crate,$(CRATES),$(eval $(call DEF_LIB_DOC,$(crate))))
266266

267267
COMPILER_DOC_TARGETS := $(CRATES:%=doc/%/index.html)
268-
ifdef CFG_COMPILER_DOCS
268+
ifdef CFG_ENABLE_COMPILER_DOCS
269269
DOC_TARGETS += $(COMPILER_DOC_TARGETS)
270270
else
271271
DOC_TARGETS += $(DOC_CRATES:%=doc/%/index.html)

branches/snap-stage3/mk/main.mk

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
7474
endif
7575
endif
7676

77-
CFG_BUILD_DATE = $(shell date +%F)
78-
CFG_VERSION += (built $(CFG_BUILD_DATE))
79-
8077
# Windows exe's need numeric versions - don't use anything but
8178
# numbers and dots here
8279
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
@@ -130,9 +127,7 @@ CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)
130127

131128
ifdef CFG_ENABLE_DEBUG_ASSERTIONS
132129
$(info cfg: enabling debug assertions (CFG_ENABLE_DEBUG_ASSERTIONS))
133-
CFG_RUSTC_FLAGS += --cfg debug -C debug-assertions=on
134-
else
135-
CFG_RUSTC_FLAGS += --cfg ndebug
130+
CFG_RUSTC_FLAGS += -C debug-assertions=on
136131
endif
137132

138133
ifdef CFG_ENABLE_DEBUGINFO
@@ -334,7 +329,6 @@ endif
334329
ifdef CFG_VER_HASH
335330
export CFG_VER_HASH
336331
endif
337-
export CFG_BUILD_DATE
338332
export CFG_VERSION
339333
export CFG_VERSION_WIN
340334
export CFG_RELEASE

branches/snap-stage3/mk/target.mk

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,42 @@ $(foreach host,$(CFG_HOST), \
181181
$(foreach stage,$(STAGES), \
182182
$(foreach tool,$(TOOLS), \
183183
$(eval $(call TARGET_TOOL,$(stage),$(target),$(host),$(tool)))))))
184+
185+
# We have some triples which are bootstrapped from other triples, and this means
186+
# that we need to fixup some of the native tools that a triple depends on.
187+
#
188+
# For example, MSVC requires the llvm-ar.exe executable to manage archives, but
189+
# it bootstraps from the GNU Windows triple. This means that the compiler will
190+
# add this directory to PATH when executing new processes:
191+
#
192+
# $SYSROOT/rustlib/x86_64-pc-windows-gnu/bin
193+
#
194+
# Unfortunately, however, the GNU triple is not known about in stage0, so the
195+
# tools are actually located in:
196+
#
197+
# $SYSROOT/rustlib/x86_64-pc-windows-msvc/bin
198+
#
199+
# To remedy this problem, the rules below copy all native tool dependencies into
200+
# the bootstrap triple's location in stage 0 so the bootstrap compiler can find
201+
# the right sets of tools. Later stages (1+) will have the right host triple for
202+
# the compiler, so there's no need to worry there.
203+
#
204+
# $(1) - stage
205+
# $(2) - triple that's being used as host/target
206+
# $(3) - triple snapshot is built for
207+
# $(4) - crate
208+
# $(5) - tool
209+
define MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR
210+
ifneq (,$(3))
211+
$$(TLIB$(1)_T_$(2)_H_$(2))/stamp.$(4): $$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5)
212+
213+
$$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5): $$(TBIN$(1)_T_$(2)_H_$(2))/$(5)
214+
mkdir -p $$(@D)
215+
cp $$< $$@
216+
endif
217+
endef
218+
219+
$(foreach target,$(CFG_TARGET), \
220+
$(foreach crate,$(CRATES), \
221+
$(foreach tool,$(NATIVE_TOOL_DEPS_$(crate)_T_$(target)), \
222+
$(eval $(call MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR,0,$(target),$(BOOTSTRAP_FROM_$(target)),$(crate),$(tool))))))

branches/snap-stage3/mk/tests.mk

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,23 +172,24 @@ check: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2 tidy
172172
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
173173

174174
# As above but don't bother running tidy.
175-
check-notidy: cleantmptestlogs cleantestlibs all check-stage2
175+
check-notidy: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2
176176
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
177177

178178
# A slightly smaller set of tests for smoke testing.
179-
check-lite: cleantestlibs cleantmptestlogs \
179+
check-lite: check-sanitycheck cleantestlibs cleantmptestlogs \
180180
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
181181
check-stage2-rpass check-stage2-rpass-valgrind \
182182
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
183183
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
184184

185185
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
186-
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
187-
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
186+
check-ref: check-sanitycheck cleantestlibs cleantmptestlogs check-stage2-rpass \
187+
check-stage2-rpass-valgrind check-stage2-rfail check-stage2-cfail check-stage2-pfail \
188+
check-stage2-rmake
188189
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
189190

190191
# Only check the docs.
191-
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
192+
check-docs: check-sanitycheck cleantestlibs cleantmptestlogs check-stage2-docs
192193
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
193194

194195
# Some less critical tests that are not prone to breakage.

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use std::fmt;
2424
use std::fs::{self, File};
2525
use std::io::BufReader;
2626
use std::io::prelude::*;
27-
use std::iter::repeat;
2827
use std::net::TcpStream;
2928
use std::path::{Path, PathBuf};
3029
use std::process::{Command, Output, ExitStatus};
@@ -652,7 +651,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
652651

653652
// Write debugger script:
654653
// We don't want to hang when calling `quit` while the process is still running
655-
let mut script_str = String::from_str("settings set auto-confirm true\n");
654+
let mut script_str = String::from("settings set auto-confirm true\n");
656655

657656
// Make LLDB emit its version, so we have it documented in the test output
658657
script_str.push_str("version\n");
@@ -928,12 +927,12 @@ fn check_forbid_output(props: &TestProps,
928927
}
929928
}
930929

931-
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
930+
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError>,
932931
testfile: &Path,
933932
proc_res: &ProcRes) {
934933

935934
// true if we found the error in question
936-
let mut found_flags: Vec<_> = repeat(false).take(expected_errors.len()).collect();
935+
let mut found_flags = vec![false; expected_errors.len()];
937936

938937
if proc_res.status.success() {
939938
fatal("process did not return an error status");
@@ -954,14 +953,10 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
954953
}
955954
}
956955

957-
// A multi-line error will have followup lines which will always
958-
// start with one of these strings.
956+
// A multi-line error will have followup lines which start with a space
957+
// or open paren.
959958
fn continuation( line: &str) -> bool {
960-
line.starts_with(" expected") ||
961-
line.starts_with(" found") ||
962-
// 1234
963-
// Should have 4 spaces: see issue 18946
964-
line.starts_with("(")
959+
line.starts_with(" ") || line.starts_with("(")
965960
}
966961

967962
// Scan and extract our error/warning messages,

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ series of small examples.
2525
If you need help with something, or just want to talk about Rust with others,
2626
there are a few places you can do that:
2727

28-
The Rust IRC channels on [irc.mozilla.org](http://irc.mozilla.org/) are the
28+
The Rust IRC channels on [irc.mozilla.org](irc://irc.mozilla.org/) are the
2929
fastest way to get help.
3030
[`#rust`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) is
3131
the general discussion channel, and you'll find people willing to help you with
@@ -40,15 +40,15 @@ There's also
4040
[`#rust-internals`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals), which is for discussion of the development of Rust itself.
4141

4242
You can also get help on [Stack
43-
Overflow](http://stackoverflow.com/questions/tagged/rust). Searching for your
43+
Overflow](https://stackoverflow.com/questions/tagged/rust). Searching for your
4444
problem might reveal someone who has asked it before!
4545

46-
There is an active [subreddit](http://reddit.com/r/rust) with lots of
46+
There is an active [subreddit](https://reddit.com/r/rust) with lots of
4747
discussion and news about Rust.
4848

49-
There is also a [user forum](http://users.rust-lang.org), for all
50-
user-oriented discussion, and a [developer
51-
forum](http://internals.rust-lang.org/), where the development of Rust
49+
There is also a [user forum](https://users.rust-lang.org), for all
50+
user-oriented discussion, and a [developer
51+
forum](https://internals.rust-lang.org/), where the development of Rust
5252
itself is discussed.
5353

5454
# Specification
@@ -61,7 +61,7 @@ the language in as much detail as possible is in [the reference](reference.html)
6161
Rust is still a young language, so there isn't a ton of tooling yet, but the
6262
tools we have are really nice.
6363

64-
[Cargo](http://crates.io) is Rust's package manager, and its website contains
64+
[Cargo](https://crates.io) is Rust's package manager, and its website contains
6565
lots of good documentation.
6666

6767
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.
@@ -86,3 +86,14 @@ something if you know its name.
8686

8787
If you encounter an error while compiling your code you may be able to look it
8888
up in the [Rust Compiler Error Index](error-index.html).
89+
90+
# Community Translations
91+
92+
Several projects have been started to translate the documentation into other
93+
languages:
94+
95+
- [Russian](https://github.com/kgv/rust_book_ru)
96+
- [Korean](https://github.com/rust-kr/doc.rust-kr.org)
97+
- [Chinese](https://github.com/KaiserY/rust-book-chinese)
98+
- [Spanish](https://github.com/goyox86/elpr)
99+

0 commit comments

Comments
 (0)