Skip to content

Commit fe3dd0b

Browse files
committed
Merge remote-tracking branch 'origin/master' into azure-pipelines
2 parents e764f47 + 50a0def commit fe3dd0b

File tree

1,132 files changed

+14612
-7499
lines changed

Some content is hidden

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

1,132 files changed

+14612
-7499
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ Mark Sinclair <[email protected]> =Mark Sinclair <[email protected]>
155155
Markus Westerlind <[email protected]> Markus <[email protected]>
156156
Martin Hafskjold Thoresen <[email protected]>
157157
Matej Lach <[email protected]> Matej Ľach <[email protected]>
158+
159+
158160
159161
Matthew Auld <[email protected]>
160162

Cargo.lock

Lines changed: 92 additions & 79 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,15 @@ build.
130130
#### MSVC
131131
[windows-msvc]: #windows-msvc
132132

133-
MSVC builds of Rust additionally require an installation of Visual Studio 2013
134-
(or later) so `rustc` can use its linker. Make sure to check the “C++ tools”
135-
option.
133+
MSVC builds of Rust additionally require an installation of Visual Studio 2017
134+
(or later) so `rustc` can use its linker. The simplest way is to get the
135+
[Visual Studio Build Tools] and check the “C++ build tools” workload.
136+
137+
[Visual Studio Build Tools]: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
138+
139+
At last check (cmake 3.14.3 and msvc 16.0.3) using the 2019 tools fails to
140+
build the in-tree LLVM build with a CMake error, so use 2017 instead by
141+
including the “MSVC v141 – VS 2017 C++ x64/x86 build tools (v14.16)” component.
136142

137143
With these dependencies installed, you can build the compiler in a `cmd.exe`
138144
shell with:

RELEASES.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,109 @@
1+
Version 1.35.0 (2019-05-23)
2+
==========================
3+
4+
Language
5+
--------
6+
- [`FnOnce`, `FnMut`, and the `Fn` traits are now implemented for `Box<FnOnce>`,
7+
`Box<FnMut>`, and `Box<Fn>` respectively.][59500]
8+
- [You can now coerce closures into unsafe function pointers.][59580] e.g.
9+
```rust
10+
unsafe fn call_unsafe(func: unsafe fn()) {
11+
func()
12+
}
13+
14+
pub fn main() {
15+
unsafe { call_unsafe(|| {}); }
16+
}
17+
```
18+
19+
20+
Compiler
21+
--------
22+
- [Added the `armv6-unknown-freebsd-gnueabihf` and
23+
`armv7-unknown-freebsd-gnueabihf` targets.][58080]
24+
- [Added the `wasm32-unknown-wasi` target.][59464]
25+
26+
27+
Libraries
28+
---------
29+
- [`Thread` will now show its ID in `Debug` output.][59460]
30+
- [`StdinLock`, `StdoutLock`, and `StderrLock` now implement `AsRawFd`.][59512]
31+
- [`alloc::System` now implements `Default`.][59451]
32+
- [Expanded `Debug` output (`{:#?}`) for structs now has a trailing comma on the
33+
last field.][59076]
34+
- [`char::{ToLowercase, ToUppercase}` now
35+
implement `ExactSizeIterator`.][58778]
36+
- [All `NonZero` numeric types now implement `FromStr`.][58717]
37+
- [Removed the `Read` trait bounds
38+
on the `BufReader::{get_ref, get_mut, into_inner}` methods.][58423]
39+
- [You can now call the `dbg!` macro without any parameters to print the file
40+
and line where it is called.][57847]
41+
- [In place ASCII case conversions are now up to 4× faster.][59283]
42+
e.g. `str::make_ascii_lowercase`
43+
- [`hash_map::{OccupiedEntry, VacantEntry}` now implement `Sync`
44+
and `Send`.][58369]
45+
46+
Stabilized APIs
47+
---------------
48+
- [`f32::copysign`]
49+
- [`f64::copysign`]
50+
- [`RefCell::replace_with`]
51+
- [`RefCell::map_split`]
52+
- [`ptr::hash`]
53+
- [`Range::contains`]
54+
- [`RangeFrom::contains`]
55+
- [`RangeTo::contains`]
56+
- [`RangeInclusive::contains`]
57+
- [`RangeToInclusive::contains`]
58+
- [`Option::copied`]
59+
60+
Cargo
61+
-----
62+
- [You can now set `cargo:rustc-cdylib-link-arg` at build time to pass custom
63+
linker arguments when building a `cdylib`.][cargo/6298] Its usage is highly
64+
platform specific.
65+
66+
Misc
67+
----
68+
- [The Rust toolchain is now available natively for musl based distros.][58575]
69+
70+
[59460]: https://github.com/rust-lang/rust/pull/59460/
71+
[59464]: https://github.com/rust-lang/rust/pull/59464/
72+
[59500]: https://github.com/rust-lang/rust/pull/59500/
73+
[59512]: https://github.com/rust-lang/rust/pull/59512/
74+
[59580]: https://github.com/rust-lang/rust/pull/59580/
75+
[59283]: https://github.com/rust-lang/rust/pull/59283/
76+
[59451]: https://github.com/rust-lang/rust/pull/59451/
77+
[59076]: https://github.com/rust-lang/rust/pull/59076/
78+
[58778]: https://github.com/rust-lang/rust/pull/58778/
79+
[58717]: https://github.com/rust-lang/rust/pull/58717/
80+
[58369]: https://github.com/rust-lang/rust/pull/58369/
81+
[58423]: https://github.com/rust-lang/rust/pull/58423/
82+
[58080]: https://github.com/rust-lang/rust/pull/58080/
83+
[57847]: https://github.com/rust-lang/rust/pull/57847/
84+
[58575]: https://github.com/rust-lang/rust/pull/58575
85+
[cargo/6298]: https://github.com/rust-lang/cargo/pull/6298/
86+
[`f32::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f32.html#method.copysign
87+
[`f64::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f64.html#method.copysign
88+
[`RefCell::replace_with`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.replace_with
89+
[`RefCell::map_split`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.map_split
90+
[`ptr::hash`]: https://doc.rust-lang.org/stable/std/ptr/fn.hash.html
91+
[`Range::contains`]: https://doc.rust-lang.org/std/ops/struct.Range.html#method.contains
92+
[`RangeFrom::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeFrom.html#method.contains
93+
[`RangeTo::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeTo.html#method.contains
94+
[`RangeInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html#method.contains
95+
[`RangeToInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeToInclusive.html#method.contains
96+
[`Option::copied`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.copied
97+
98+
Version 1.34.2 (2019-05-14)
99+
===========================
100+
101+
* [Destabilize the `Error::type_id` function due to a security
102+
vulnerability][60785] ([CVE-2019-12083])
103+
104+
[60785]: https://github.com/rust-lang/rust/pull/60785
105+
[CVE-2019-12083]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12083
106+
1107
Version 1.34.1 (2019-04-25)
2108
===========================
3109

config.toml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
# linked binaries
481481
#musl-root = "..."
482482

483-
# The root location of the `wasm32-unknown-wasi` sysroot.
483+
# The root location of the `wasm32-wasi` sysroot.
484484
#wasi-root = "..."
485485

486486
# Used in testing for configuring where the QEMU images are located, you

src/bootstrap/bootstrap.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ def default_build_triple():
177177
# The goal here is to come up with the same triple as LLVM would,
178178
# at least for the subset of platforms we're willing to target.
179179
ostype_mapper = {
180-
'Bitrig': 'unknown-bitrig',
181180
'Darwin': 'apple-darwin',
182181
'DragonFly': 'unknown-dragonfly',
183182
'FreeBSD': 'unknown-freebsd',

src/bootstrap/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn std_cargo(builder: &Builder<'_>,
168168
.arg("--manifest-path")
169169
.arg(builder.src.join("src/liballoc/Cargo.toml"))
170170
.arg("--features")
171-
.arg("compiler-builtins-mem");
171+
.arg("compiler-builtins-mem compiler-builtins-c");
172172
} else {
173173
let features = builder.std_features();
174174

src/bootstrap/native.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
317317
fn configure_cmake(builder: &Builder<'_>,
318318
target: Interned<String>,
319319
cfg: &mut cmake::Config) {
320+
// Do not print installation messages for up-to-date files.
321+
// LLVM and LLD builds can produce a lot of those and hit CI limits on log size.
322+
cfg.define("CMAKE_INSTALL_MESSAGE", "LAZY");
323+
320324
if builder.config.ninja {
321325
cfg.generator("Ninja");
322326
}

src/bootstrap/test.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ impl Step for RustdocUi {
683683
target: self.target,
684684
mode: "ui",
685685
suite: "rustdoc-ui",
686-
path: None,
686+
path: Some("src/test/rustdoc-ui"),
687687
compare_mode: None,
688688
})
689689
}
@@ -1184,8 +1184,19 @@ impl Step for Compiletest {
11841184
Err(_) => p,
11851185
}
11861186
})
1187-
.filter(|p| p.starts_with(suite_path) && p.is_file())
1188-
.map(|p| p.strip_prefix(suite_path).unwrap().to_str().unwrap())
1187+
.filter(|p| p.starts_with(suite_path) && (p.is_dir() || p.is_file()))
1188+
.filter_map(|p| {
1189+
// Since test suite paths are themselves directories, if we don't
1190+
// specify a directory or file, we'll get an empty string here
1191+
// (the result of the test suite directory without its suite prefix).
1192+
// Therefore, we need to filter these out, as only the first --test-args
1193+
// flag is respected, so providing an empty --test-args conflicts with
1194+
// any following it.
1195+
match p.strip_prefix(suite_path).ok().and_then(|p| p.to_str()) {
1196+
Some(s) if s != "" => Some(s),
1197+
_ => None,
1198+
}
1199+
})
11891200
.collect();
11901201

11911202
test_args.append(&mut builder.config.cmd.test_args());
@@ -1870,6 +1881,10 @@ impl Step for CrateRustdoc {
18701881
cargo.arg("--");
18711882
cargo.args(&builder.config.cmd.test_args());
18721883

1884+
if self.host.contains("musl") {
1885+
cargo.arg("'-Ctarget-feature=-crt-static'");
1886+
}
1887+
18731888
if !builder.config.verbose_tests {
18741889
cargo.arg("--quiet");
18751890
}

src/build_helper/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub fn gnu_target(target: &str) -> &str {
113113
}
114114

115115
pub fn make(host: &str) -> PathBuf {
116-
if host.contains("bitrig") || host.contains("dragonfly") || host.contains("freebsd")
116+
if host.contains("dragonfly") || host.contains("freebsd")
117117
|| host.contains("netbsd") || host.contains("openbsd")
118118
{
119119
PathBuf::from("gmake")

src/ci/docker/dist-various-2/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ ENV CARGO_TARGET_AARCH64_FUCHSIA_RUSTFLAGS \
7575
ENV TARGETS=x86_64-fuchsia
7676
ENV TARGETS=$TARGETS,aarch64-fuchsia
7777
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
78-
ENV TARGETS=$TARGETS,wasm32-unknown-wasi
78+
ENV TARGETS=$TARGETS,wasm32-wasi
7979
# FIXME(#61022) - reenable solaris
8080
# ENV TARGETS=$TARGETS,sparcv9-sun-solaris
8181
# ENV TARGETS=$TARGETS,x86_64-sun-solaris
@@ -87,5 +87,5 @@ ENV TARGETS=$TARGETS,nvptx64-nvidia-cuda
8787
ENV X86_FORTANIX_SGX_LIBS="/x86_64-fortanix-unknown-sgx/lib/"
8888

8989
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \
90-
--set target.wasm32-unknown-wasi.wasi-root=/wasm32-unknown-wasi
90+
--set target.wasm32-wasi.wasi-root=/wasm32-wasi
9191
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

src/ci/docker/dist-various-2/build-wasi-toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ git clone https://github.com/CraneStation/wasi-sysroot
1313

1414
cd wasi-sysroot
1515
git reset --hard e5f14be38362f1ab83302895a6e74b2ffd0e2302
16-
make -j$(nproc) INSTALL_DIR=/wasm32-unknown-wasi install
16+
make -j$(nproc) INSTALL_DIR=/wasm32-wasi install
1717

1818
cd ..
1919
rm -rf reference-sysroot-wasi

src/ci/docker/dist-x86_64-musl/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY scripts/musl-toolchain.sh /build/
2323
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
2424
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
2525
CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
26-
bash musl-toolchain.sh x86_64 && rm -rf build
26+
REPLACE_CC=1 bash musl-toolchain.sh x86_64 && rm -rf build
2727

2828
COPY scripts/sccache.sh /scripts/
2929
RUN sh /scripts/sccache.sh
@@ -35,10 +35,7 @@ ENV RUST_CONFIGURE_ARGS \
3535
--enable-extended \
3636
--disable-docs \
3737
--set target.x86_64-unknown-linux-musl.crt-static=false \
38-
--build $HOSTS \
39-
--set target.x86_64-unknown-linux-musl.cc=x86_64-linux-musl-gcc \
40-
--set target.x86_64-unknown-linux-musl.cxx=x86_64-linux-musl-g++ \
41-
--set target.x86_64-unknown-linux-musl.linker=x86_64-linux-musl-gcc
38+
--build $HOSTS
4239

4340
# Newer binutils broke things on some vms/distros (i.e., linking against
4441
# unknown relocs disabled by the following flag), so we need to go out of our
@@ -49,4 +46,5 @@ ENV RUST_CONFIGURE_ARGS \
4946
ENV CFLAGS_x86_64_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none \
5047
-Wl,--compress-debug-sections=none"
5148

49+
# To run native tests replace `dist` below with `test`
5250
ENV SCRIPT python2.7 ../x.py dist --build $HOSTS

src/ci/docker/scripts/musl-toolchain.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ cd -
4545
ln -s $OUTPUT/$TARGET/lib/libc.so /lib/ld-musl-$ARCH.so.1
4646
echo $OUTPUT/$TARGET/lib >> /etc/ld-musl-$ARCH.path
4747

48+
# Now when musl bootstraps itself create proper toolchain symlinks to make build and tests easier
49+
if [ "$REPLACE_CC" = "1" ]; then
50+
for exec in cc gcc; do
51+
ln -s $TARGET-gcc /usr/local/bin/$exec
52+
done
53+
for exec in cpp c++ g++; do
54+
ln -s $TARGET-g++ /usr/local/bin/$exec
55+
done
56+
fi
4857

4958
export CC=$TARGET-gcc
5059
export CXX=$TARGET-g++

src/ci/docker/x86_64-gnu-tools/checktools.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ status_check() {
7474
check_dispatch $1 beta nomicon src/doc/nomicon
7575
check_dispatch $1 beta reference src/doc/reference
7676
check_dispatch $1 beta rust-by-example src/doc/rust-by-example
77-
check_dispatch $1 beta edition-guide src/doc/edition-guide
77+
# Temporarily disabled until
78+
# https://github.com/rust-lang/rust/issues/60459 is fixed.
79+
# check_dispatch $1 beta edition-guide src/doc/edition-guide
7880
check_dispatch $1 beta rls src/tools/rls
7981
check_dispatch $1 beta rustfmt src/tools/rustfmt
8082
check_dispatch $1 beta clippy-driver src/tools/clippy

src/doc/edition-guide

src/doc/nomicon

src/doc/reference

src/doc/rustc-guide

0 commit comments

Comments
 (0)