Skip to content

Commit 8ac5380

Browse files
authored
Merge branch 'master' into copied
2 parents b4a306c + ddab10a commit 8ac5380

File tree

1,381 files changed

+24994
-12350
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,381 files changed

+24994
-12350
lines changed

.gitmodules

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
[submodule "src/rust-installer"]
66
path = src/tools/rust-installer
77
url = https://github.com/rust-lang/rust-installer.git
8-
[submodule "src/liblibc"]
9-
path = src/liblibc
10-
url = https://github.com/rust-lang/libc.git
118
[submodule "src/doc/nomicon"]
129
path = src/doc/nomicon
1310
url = https://github.com/rust-lang-nursery/nomicon.git
@@ -23,9 +20,6 @@
2320
[submodule "src/tools/rls"]
2421
path = src/tools/rls
2522
url = https://github.com/rust-lang-nursery/rls.git
26-
[submodule "src/libcompiler_builtins"]
27-
path = src/libcompiler_builtins
28-
url = https://github.com/rust-lang-nursery/compiler-builtins.git
2923
[submodule "src/tools/clippy"]
3024
path = src/tools/clippy
3125
url = https://github.com/rust-lang-nursery/rust-clippy.git
@@ -35,9 +29,6 @@
3529
[submodule "src/tools/miri"]
3630
path = src/tools/miri
3731
url = https://github.com/solson/miri.git
38-
[submodule "src/dlmalloc"]
39-
path = src/dlmalloc
40-
url = https://github.com/alexcrichton/dlmalloc-rs.git
4132
[submodule "src/doc/rust-by-example"]
4233
path = src/doc/rust-by-example
4334
url = https://github.com/rust-lang/rust-by-example.git
@@ -61,7 +52,6 @@
6152
path = src/tools/clang
6253
url = https://github.com/rust-lang-nursery/clang.git
6354
branch = rust-release-80-v2
64-
6555
[submodule "src/doc/rustc-guide"]
6656
path = src/doc/rustc-guide
6757
url = https://github.com/rust-lang/rustc-guide.git

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ matrix:
1616
fast_finish: true
1717
include:
1818
# Images used in testing PR and try-build should be run first.
19-
- env: IMAGE=x86_64-gnu-llvm-5.0 RUST_BACKTRACE=1
19+
- env: IMAGE=x86_64-gnu-llvm-6.0 RUST_BACKTRACE=1
2020
if: type = pull_request OR branch = auto
2121

2222
- env: IMAGE=dist-x86_64-linux DEPLOY=1

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ don't know about, so please report liberally. If you're not sure if something
3939
is a bug or not, feel free to file a bug anyway.
4040

4141
**If you believe reporting your bug publicly represents a security risk to Rust users,
42-
please follow our [instructions for reporting security vulnerabilities](https://www.rust-lang.org/security.html)**.
42+
please follow our [instructions for reporting security vulnerabilities](https://www.rust-lang.org/policies/security)**.
4343

4444
If you have the chance, before reporting a bug, please [search existing
4545
issues](https://github.com/rust-lang/rust/search?q=&type=Issues&utf8=%E2%9C%93),

Cargo.lock

Lines changed: 782 additions & 669 deletions
Large diffs are not rendered by default.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ rustfmt-nightly = { path = "src/tools/rustfmt" }
6565
# here
6666
rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
6767

68+
# See comments in `tools/rustc-std-workspace-core/README.md` for what's going on
69+
# here
70+
rustc-std-workspace-core = { path = 'src/tools/rustc-std-workspace-core' }
71+
6872
[patch."https://github.com/rust-lang/rust-clippy"]
6973
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
7074
rustc_tools_util = { path = "src/tools/clippy/rustc_tools_util" }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ standard library, and documentation.
1010

1111
Read ["Installation"] from [The Book].
1212

13-
["Installation"]: https://doc.rust-lang.org/book/second-edition/ch01-01-installation.html
13+
["Installation"]: https://doc.rust-lang.org/book/ch01-01-installation.html
1414
[The Book]: https://doc.rust-lang.org/book/index.html
1515

1616
## Building from Source

RELEASES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version 1.31.1 (2018-12-20)
2+
===========================
3+
4+
- [Fix Rust failing to build on `powerpc-unknown-netbsd`][56562]
5+
- [Fix broken go-to-definition in RLS][rls/1171]
6+
- [Fix infinite loop on hover in RLS][rls/1170]
7+
8+
[56562]: https://github.com/rust-lang/rust/pull/56562
9+
[rls/1171]: https://github.com/rust-lang/rls/issues/1171
10+
[rls/1170]: https://github.com/rust-lang/rls/pull/1170
11+
112
Version 1.31.0 (2018-12-06)
213
==========================
314

src/bootstrap/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
authors = ["The Rust Project Developers"]
33
name = "bootstrap"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "bootstrap"

src/bootstrap/bootstrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,10 @@ def update_submodule(self, module, checked_out, recorded_submodules):
678678

679679
print("Updating submodule", module)
680680

681-
run(["git", "submodule", "-q", "sync", module],
681+
run(["git", "submodule", "-q", "sync", "--progress", module],
682682
cwd=self.rust_root, verbose=self.verbose)
683683
run(["git", "submodule", "update",
684-
"--init", "--recursive", module],
684+
"--init", "--recursive", "--progress", module],
685685
cwd=self.rust_root, verbose=self.verbose)
686686
run(["git", "reset", "-q", "--hard"],
687687
cwd=module_path, verbose=self.verbose)

src/bootstrap/builder.rs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ use std::path::{Path, PathBuf};
2121
use std::process::Command;
2222
use std::time::{Duration, Instant};
2323

24-
use cache::{Cache, Interned, INTERNER};
25-
use check;
26-
use compile;
27-
use dist;
28-
use doc;
29-
use flags::Subcommand;
30-
use install;
31-
use native;
32-
use test;
33-
use tool;
34-
use util::{add_lib_path, exe, libdir};
35-
use {Build, DocTests, Mode, GitRepo};
36-
37-
pub use Compiler;
24+
use crate::cache::{Cache, Interned, INTERNER};
25+
use crate::check;
26+
use crate::compile;
27+
use crate::dist;
28+
use crate::doc;
29+
use crate::flags::Subcommand;
30+
use crate::install;
31+
use crate::native;
32+
use crate::test;
33+
use crate::tool;
34+
use crate::util::{add_lib_path, exe, libdir};
35+
use crate::{Build, DocTests, Mode, GitRepo};
36+
37+
pub use crate::Compiler;
3838

3939
use petgraph::graph::NodeIndex;
4040
use petgraph::Graph;
@@ -389,7 +389,6 @@ impl<'a> Builder<'a> {
389389
test::UiFullDeps,
390390
test::RunPassFullDeps,
391391
test::RunFailFullDeps,
392-
test::CompileFailFullDeps,
393392
test::Rustdoc,
394393
test::Pretty,
395394
test::RunPassPretty,
@@ -417,6 +416,7 @@ impl<'a> Builder<'a> {
417416
test::Rustfmt,
418417
test::Miri,
419418
test::Clippy,
419+
test::CompiletestTest,
420420
test::RustdocJS,
421421
test::RustdocTheme,
422422
// Run bootstrap close to the end as it's unlikely to fail
@@ -685,6 +685,11 @@ impl<'a> Builder<'a> {
685685
.env("RUSTDOC_REAL", self.rustdoc(host))
686686
.env("RUSTDOC_CRATE_VERSION", self.rust_version())
687687
.env("RUSTC_BOOTSTRAP", "1");
688+
689+
// Remove make-related flags that can cause jobserver problems.
690+
cmd.env_remove("MAKEFLAGS");
691+
cmd.env_remove("MFLAGS");
692+
688693
if let Some(linker) = self.linker(host) {
689694
cmd.env("RUSTC_TARGET_LINKER", linker);
690695
}
@@ -793,7 +798,7 @@ impl<'a> Builder<'a> {
793798
}
794799

795800
// Set a flag for `check` so that certain build scripts can do less work
796-
// (e.g. not building/requiring LLVM).
801+
// (e.g., not building/requiring LLVM).
797802
if cmd == "check" {
798803
cargo.env("RUST_CHECK", "1");
799804
}
@@ -923,12 +928,12 @@ impl<'a> Builder<'a> {
923928
cargo.env("RUSTC_FORCE_UNSTABLE", "1");
924929

925930
// Currently the compiler depends on crates from crates.io, and
926-
// then other crates can depend on the compiler (e.g. proc-macro
931+
// then other crates can depend on the compiler (e.g., proc-macro
927932
// crates). Let's say, for example that rustc itself depends on the
928933
// bitflags crate. If an external crate then depends on the
929934
// bitflags crate as well, we need to make sure they don't
930935
// conflict, even if they pick the same version of bitflags. We'll
931-
// want to make sure that e.g. a plugin and rustc each get their
936+
// want to make sure that e.g., a plugin and rustc each get their
932937
// own copy of bitflags.
933938

934939
// Cargo ensures that this works in general through the -C metadata
@@ -1247,7 +1252,7 @@ impl<'a> Builder<'a> {
12471252
#[cfg(test)]
12481253
mod __test {
12491254
use super::*;
1250-
use config::Config;
1255+
use crate::config::Config;
12511256
use std::thread;
12521257

12531258
fn configure(host: &[&str], target: &[&str]) -> Config {

src/bootstrap/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::path::{Path, PathBuf};
2323
use std::sync::Mutex;
2424
use std::cmp::{PartialOrd, Ord, Ordering};
2525

26-
use builder::Step;
26+
use crate::builder::Step;
2727

2828
pub struct Interned<T>(usize, PhantomData<*const T>);
2929

src/bootstrap/cc_detect.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ use std::process::Command;
3939
use build_helper::output;
4040
use cc;
4141

42-
use {Build, GitRepo};
43-
use config::Target;
44-
use cache::Interned;
42+
use crate::{Build, GitRepo};
43+
use crate::config::Target;
44+
use crate::cache::Interned;
4545

4646
// The `cc` crate doesn't provide a way to obtain a path to the detected archiver,
4747
// so use some simplified logic here. First we respect the environment variable `AR`, then
@@ -143,7 +143,10 @@ fn set_compiler(cfg: &mut cc::Build,
143143
// compiler already takes into account the triple in question.
144144
t if t.contains("android") => {
145145
if let Some(ndk) = config.and_then(|c| c.ndk.as_ref()) {
146-
let target = target.replace("armv7", "arm");
146+
let target = target.replace("armv7neon", "arm")
147+
.replace("armv7", "arm")
148+
.replace("thumbv7neon", "arm")
149+
.replace("thumbv7", "arm");
147150
let compiler = format!("{}-{}", target, compiler.clang());
148151
cfg.compiler(ndk.join("bin").join(compiler));
149152
}

src/bootstrap/channel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ use std::process::Command;
2020

2121
use build_helper::output;
2222

23-
use Build;
24-
use config::Config;
23+
use crate::Build;
24+
use crate::config::Config;
2525

2626
// The version number
27-
pub const CFG_RELEASE_NUM: &str = "1.32.0";
27+
pub const CFG_RELEASE_NUM: &str = "1.33.0";
2828

2929
pub struct GitInfo {
3030
inner: Option<Info>,

src/bootstrap/check.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010

1111
//! Implementation of compiling the compiler and standard library, in "check" mode.
1212
13-
use compile::{run_cargo, std_cargo, test_cargo, rustc_cargo, rustc_cargo_env, add_to_sysroot};
14-
use builder::{RunConfig, Builder, ShouldRun, Step};
15-
use tool::{prepare_tool_cargo, SourceType};
16-
use {Compiler, Mode};
17-
use cache::{INTERNER, Interned};
13+
use crate::compile::{run_cargo, std_cargo, test_cargo, rustc_cargo, rustc_cargo_env,
14+
add_to_sysroot};
15+
use crate::builder::{RunConfig, Builder, ShouldRun, Step};
16+
use crate::tool::{prepare_tool_cargo, SourceType};
17+
use crate::{Compiler, Mode};
18+
use crate::cache::{INTERNER, Interned};
1819
use std::path::PathBuf;
1920

2021
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

src/bootstrap/clean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::fs;
1919
use std::io::{self, ErrorKind};
2020
use std::path::Path;
2121

22-
use Build;
22+
use crate::Build;
2323

2424
pub fn clean(build: &Build, all: bool) {
2525
rm_rf("tmp".as_ref());

src/bootstrap/compile.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
use std::borrow::Cow;
2020
use std::env;
21-
use std::fs::{self, File};
21+
use std::fs;
2222
use std::io::BufReader;
2323
use std::io::prelude::*;
2424
use std::path::{Path, PathBuf};
@@ -29,12 +29,12 @@ use build_helper::{output, mtime, up_to_date};
2929
use filetime::FileTime;
3030
use serde_json;
3131

32-
use util::{exe, libdir, is_dylib};
33-
use {Compiler, Mode, GitRepo};
34-
use native;
32+
use crate::util::{exe, libdir, is_dylib};
33+
use crate::{Compiler, Mode, GitRepo};
34+
use crate::native;
3535

36-
use cache::{INTERNER, Interned};
37-
use builder::{Step, RunConfig, ShouldRun, Builder};
36+
use crate::cache::{INTERNER, Interned};
37+
use crate::builder::{Step, RunConfig, ShouldRun, Builder};
3838

3939
#[derive(Debug, PartialOrd, Ord, Copy, Clone, PartialEq, Eq, Hash)]
4040
pub struct Std {
@@ -152,11 +152,12 @@ pub fn std_cargo(builder: &Builder,
152152

153153
if builder.no_std(target) == Some(true) {
154154
// for no-std targets we only compile a few no_std crates
155-
cargo.arg("--features").arg("c mem")
155+
cargo
156156
.args(&["-p", "alloc"])
157-
.args(&["-p", "compiler_builtins"])
158157
.arg("--manifest-path")
159-
.arg(builder.src.join("src/rustc/compiler_builtins_shim/Cargo.toml"));
158+
.arg(builder.src.join("src/liballoc/Cargo.toml"))
159+
.arg("--features")
160+
.arg("compiler-builtins-mem");
160161
} else {
161162
let features = builder.std_features();
162163

@@ -707,7 +708,7 @@ impl Step for CodegenBackend {
707708
}
708709
let stamp = codegen_backend_stamp(builder, compiler, target, backend);
709710
let codegen_backend = codegen_backend.to_str().unwrap();
710-
t!(t!(File::create(&stamp)).write_all(codegen_backend.as_bytes()));
711+
t!(fs::write(&stamp, &codegen_backend));
711712
}
712713
}
713714

@@ -796,8 +797,7 @@ fn copy_codegen_backends_to_sysroot(builder: &Builder,
796797

797798
for backend in builder.config.rust_codegen_backends.iter() {
798799
let stamp = codegen_backend_stamp(builder, compiler, target, *backend);
799-
let mut dylib = String::new();
800-
t!(t!(File::open(&stamp)).read_to_string(&mut dylib));
800+
let dylib = t!(fs::read_to_string(&stamp));
801801
let file = Path::new(&dylib);
802802
let filename = file.file_name().unwrap().to_str().unwrap();
803803
// change `librustc_codegen_llvm-xxxxxx.so` to `librustc_codegen_llvm-llvm.so`
@@ -1137,10 +1137,7 @@ pub fn run_cargo(builder: &Builder,
11371137
// contents (the list of files to copy) is different or if any dep's mtime
11381138
// is newer then we rewrite the stamp file.
11391139
deps.sort();
1140-
let mut stamp_contents = Vec::new();
1141-
if let Ok(mut f) = File::open(stamp) {
1142-
t!(f.read_to_end(&mut stamp_contents));
1143-
}
1140+
let stamp_contents = fs::read(stamp);
11441141
let stamp_mtime = mtime(&stamp);
11451142
let mut new_contents = Vec::new();
11461143
let mut max = None;
@@ -1156,7 +1153,10 @@ pub fn run_cargo(builder: &Builder,
11561153
}
11571154
let max = max.unwrap();
11581155
let max_path = max_path.unwrap();
1159-
if stamp_contents == new_contents && max <= stamp_mtime {
1156+
let contents_equal = stamp_contents
1157+
.map(|contents| contents == new_contents)
1158+
.unwrap_or_default();
1159+
if contents_equal && max <= stamp_mtime {
11601160
builder.verbose(&format!("not updating {:?}; contents equal and {:?} <= {:?}",
11611161
stamp, max, stamp_mtime));
11621162
return deps
@@ -1166,7 +1166,7 @@ pub fn run_cargo(builder: &Builder,
11661166
} else {
11671167
builder.verbose(&format!("updating {:?} as deps changed", stamp));
11681168
}
1169-
t!(t!(File::create(stamp)).write_all(&new_contents));
1169+
t!(fs::write(&stamp, &new_contents));
11701170
deps
11711171
}
11721172

0 commit comments

Comments
 (0)