Skip to content

Commit ad00e53

Browse files
authored
Merge pull request #7 from rust-lang/master
update from origin 2020-06-27
2 parents 50a6d07 + 394e1b4 commit ad00e53

File tree

604 files changed

+6942
-2793
lines changed

Some content is hidden

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

604 files changed

+6942
-2793
lines changed

Cargo.lock

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ dependencies = [
434434

435435
[[package]]
436436
name = "chalk-derive"
437-
version = "0.11.0"
437+
version = "0.14.0"
438438
source = "registry+https://github.com/rust-lang/crates.io-index"
439-
checksum = "5b9bd01eab87277d973183a1d2e56bace1c11f8242c52c20636fb7dddf343ac9"
439+
checksum = "d463e01905d607e181de72e8608721d3269f29176c9a14ce037011316ae7131d"
440440
dependencies = [
441441
"proc-macro2 1.0.3",
442442
"quote 1.0.2",
@@ -446,30 +446,31 @@ dependencies = [
446446

447447
[[package]]
448448
name = "chalk-engine"
449-
version = "0.11.0"
449+
version = "0.14.0"
450450
source = "registry+https://github.com/rust-lang/crates.io-index"
451-
checksum = "6c7a637c3d17ed555aef16e16952a5d1e127bd55178cc30be22afeb92da90c7d"
451+
checksum = "efaf428f5398d36284f79690cf988762b7c091249f50a6c11db613a46c057000"
452452
dependencies = [
453453
"chalk-derive",
454454
"chalk-ir",
455455
"rustc-hash",
456+
"tracing",
456457
]
457458

458459
[[package]]
459460
name = "chalk-ir"
460-
version = "0.11.0"
461+
version = "0.14.0"
461462
source = "registry+https://github.com/rust-lang/crates.io-index"
462-
checksum = "595e5735ded16c3f3dc348f7b15bbb2521a0080b1863cac38ad5271589944670"
463+
checksum = "fd3fdc1e9f68498ffe80f4a23b0b95f1ca6fb21d5a4c9b0c085fab3ca712bdbe"
463464
dependencies = [
464465
"chalk-derive",
465466
"lazy_static",
466467
]
467468

468469
[[package]]
469470
name = "chalk-solve"
470-
version = "0.11.0"
471+
version = "0.14.0"
471472
source = "registry+https://github.com/rust-lang/crates.io-index"
472-
checksum = "5d9d938139db425867a30cc0cfec0269406d8238d0571d829041eaa7a8455d11"
473+
checksum = "5b9fd4102807b7ebe8fb034fa0f488c5656e1966d3261b558b81a08d519cdb29"
473474
dependencies = [
474475
"chalk-derive",
475476
"chalk-engine",
@@ -478,6 +479,7 @@ dependencies = [
478479
"itertools 0.9.0",
479480
"petgraph",
480481
"rustc-hash",
482+
"tracing",
481483
]
482484

483485
[[package]]
@@ -5332,6 +5334,37 @@ dependencies = [
53325334
"syn 0.15.35",
53335335
]
53345336

5337+
[[package]]
5338+
name = "tracing"
5339+
version = "0.1.15"
5340+
source = "registry+https://github.com/rust-lang/crates.io-index"
5341+
checksum = "a41f40ed0e162c911ac6fcb53ecdc8134c46905fdbbae8c50add462a538b495f"
5342+
dependencies = [
5343+
"cfg-if",
5344+
"tracing-attributes",
5345+
"tracing-core",
5346+
]
5347+
5348+
[[package]]
5349+
name = "tracing-attributes"
5350+
version = "0.1.8"
5351+
source = "registry+https://github.com/rust-lang/crates.io-index"
5352+
checksum = "99bbad0de3fd923c9c3232ead88510b783e5a4d16a6154adffa3d53308de984c"
5353+
dependencies = [
5354+
"proc-macro2 1.0.3",
5355+
"quote 1.0.2",
5356+
"syn 1.0.11",
5357+
]
5358+
5359+
[[package]]
5360+
name = "tracing-core"
5361+
version = "0.1.10"
5362+
source = "registry+https://github.com/rust-lang/crates.io-index"
5363+
checksum = "0aa83a9a47081cd522c09c81b31aec2c9273424976f922ad61c053b58350b715"
5364+
dependencies = [
5365+
"lazy_static",
5366+
]
5367+
53355368
[[package]]
53365369
name = "try-lock"
53375370
version = "0.2.2"
@@ -5405,15 +5438,15 @@ dependencies = [
54055438

54065439
[[package]]
54075440
name = "unicode-script"
5408-
version = "0.4.0"
5441+
version = "0.5.1"
54095442
source = "registry+https://github.com/rust-lang/crates.io-index"
5410-
checksum = "5b2c5c29e805da6817f5af6a627d65adb045cebf05cccd5a3493d6109454391c"
5443+
checksum = "58b33414ea8db4b7ea0343548dbdc31d27aef06beacf7044a87e564d9b0feb7d"
54115444

54125445
[[package]]
54135446
name = "unicode-security"
5414-
version = "0.0.3"
5447+
version = "0.0.5"
54155448
source = "registry+https://github.com/rust-lang/crates.io-index"
5416-
checksum = "a5f9011bbed9c13372bc8df618b55a38138445199caf3b61d432c6859c36dee0"
5449+
checksum = "5d87c28edc5b263377e448d6cdcb935c06b95413d8013ba6fae470558ccab18f"
54175450
dependencies = [
54185451
"unicode-normalization",
54195452
"unicode-script",

config.toml.example

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,24 @@
118118
# nightlies are already produced for. The current platform must be able to run
119119
# binaries of this build triple and the nightly will be used to bootstrap the
120120
# first compiler.
121-
#build = "x86_64-unknown-linux-gnu" # defaults to your host platform
121+
#
122+
# Defaults to host platform
123+
#build = "x86_64-unknown-linux-gnu"
122124

123125
# In addition to the build triple, other triples to produce full compiler
124126
# toolchains for. Each of these triples will be bootstrapped from the build
125127
# triple and then will continue to bootstrap themselves. This platform must
126128
# currently be able to run all of the triples provided here.
127-
#host = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
129+
#
130+
# Defaults to just the build triple
131+
#host = ["x86_64-unknown-linux-gnu"]
128132

129133
# In addition to all host triples, other triples to produce the standard library
130134
# for. Each host triple will be used to produce a copy of the standard library
131135
# for each target triple.
132-
#target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
136+
#
137+
# Defaults to just the build triple
138+
#target = ["x86_64-unknown-linux-gnu"]
133139

134140
# Use this directory to store build artifacts.
135141
# You can use "$ROOT" to indicate the root of the git repository.
@@ -174,7 +180,7 @@
174180
# Python interpreter to use for various tasks throughout the build, notably
175181
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
176182
#
177-
# Defaults to the Python interpreter used to execute x.py.
183+
# Defaults to the Python interpreter used to execute x.py
178184
#python = "python"
179185

180186
# Force Cargo to check that Cargo.lock describes the precise dependency
@@ -313,11 +319,15 @@
313319

314320
# Whether or not debug assertions are enabled for the compiler and standard
315321
# library.
316-
#debug-assertions = debug
322+
#
323+
# Defaults to rust.debug value
324+
#debug-assertions = false
317325

318326
# Whether or not debug assertions are enabled for the standard library.
319327
# Overrides the `debug-assertions` option, if defined.
320-
#debug-assertions-std = debug-assertions
328+
#
329+
# Defaults to rust.debug-assertions value
330+
#debug-assertions-std = false
321331

322332
# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
323333
# `0` - no debug info
@@ -326,16 +336,24 @@
326336
# Can be overridden for specific subsets of Rust code (rustc, std or tools).
327337
# Debuginfo for tests run with compiletest is not controlled by this option
328338
# and needs to be enabled separately with `debuginfo-level-tests`.
329-
#debuginfo-level = if debug { 2 } else { 0 }
339+
#
340+
# Defaults to 2 if debug is true
341+
#debuginfo-level = 0
330342

331343
# Debuginfo level for the compiler.
332-
#debuginfo-level-rustc = debuginfo-level
344+
#
345+
# Defaults to rust.debuginfo-level value
346+
#debuginfo-level-rustc = 0
333347

334348
# Debuginfo level for the standard library.
335-
#debuginfo-level-std = debuginfo-level
349+
#
350+
# Defaults to rust.debuginfo-level value
351+
#debuginfo-level-std = 0
336352

337353
# Debuginfo level for the tools.
338-
#debuginfo-level-tools = debuginfo-level
354+
#
355+
# Defaults to rust.debuginfo-level value
356+
#debuginfo-level-tools = 0
339357

340358
# Debuginfo level for the test suites run with compiletest.
341359
# FIXME(#61117): Some tests fail when this option is enabled.

src/bootstrap/bootstrap.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def default_build_triple():
184184
ostype = require(["uname", "-s"], exit=required)
185185
cputype = require(['uname', '-m'], exit=required)
186186

187+
# If we do not have `uname`, assume Windows.
187188
if ostype is None or cputype is None:
188189
return 'x86_64-pc-windows-msvc'
189190

@@ -236,6 +237,11 @@ def default_build_triple():
236237
if ostype.endswith('WOW64'):
237238
cputype = 'x86_64'
238239
ostype = 'pc-windows-gnu'
240+
elif sys.platform == 'win32':
241+
# Some Windows platforms might have a `uname` command that returns a
242+
# non-standard string (e.g. gnuwin32 tools returns `windows32`). In
243+
# these cases, fall back to using sys.platform.
244+
return 'x86_64-pc-windows-msvc'
239245
else:
240246
err = "unknown OS type: {}".format(ostype)
241247
sys.exit(err)

src/bootstrap/builder.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::install;
2323
use crate::native;
2424
use crate::run;
2525
use crate::test;
26-
use crate::tool;
26+
use crate::tool::{self, SourceType};
2727
use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir};
2828
use crate::{Build, DocTests, GitRepo, Mode};
2929

@@ -759,6 +759,7 @@ impl<'a> Builder<'a> {
759759
&self,
760760
compiler: Compiler,
761761
mode: Mode,
762+
source_type: SourceType,
762763
target: Interned<String>,
763764
cmd: &str,
764765
) -> Cargo {
@@ -1125,7 +1126,7 @@ impl<'a> Builder<'a> {
11251126

11261127
cargo.env("RUSTC_VERBOSE", self.verbosity.to_string());
11271128

1128-
if !mode.is_tool() {
1129+
if source_type == SourceType::InTree {
11291130
// When extending this list, add the new lints to the RUSTFLAGS of the
11301131
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
11311132
// some code doesn't go through this `rustc` wrapper.

src/bootstrap/check.rs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ impl Step for Std {
4444
let target = self.target;
4545
let compiler = builder.compiler(0, builder.config.build);
4646

47-
let mut cargo = builder.cargo(compiler, Mode::Std, target, cargo_subcommand(builder.kind));
47+
let mut cargo = builder.cargo(
48+
compiler,
49+
Mode::Std,
50+
SourceType::InTree,
51+
target,
52+
cargo_subcommand(builder.kind),
53+
);
4854
std_cargo(builder, target, compiler.stage, &mut cargo);
4955

5056
builder.info(&format!("Checking std artifacts ({} -> {})", &compiler.host, target));
@@ -92,8 +98,13 @@ impl Step for Rustc {
9298

9399
builder.ensure(Std { target });
94100

95-
let mut cargo =
96-
builder.cargo(compiler, Mode::Rustc, target, cargo_subcommand(builder.kind));
101+
let mut cargo = builder.cargo(
102+
compiler,
103+
Mode::Rustc,
104+
SourceType::InTree,
105+
target,
106+
cargo_subcommand(builder.kind),
107+
);
97108
rustc_cargo(builder, &mut cargo, target);
98109

99110
builder.info(&format!("Checking compiler artifacts ({} -> {})", &compiler.host, target));
@@ -113,7 +124,7 @@ impl Step for Rustc {
113124
}
114125

115126
macro_rules! tool_check_step {
116-
($name:ident, $path:expr) => {
127+
($name:ident, $path:expr, $source_type:expr) => {
117128
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
118129
pub struct $name {
119130
pub target: Interned<String>,
@@ -145,7 +156,7 @@ macro_rules! tool_check_step {
145156
target,
146157
cargo_subcommand(builder.kind),
147158
$path,
148-
SourceType::InTree,
159+
$source_type,
149160
&[],
150161
);
151162

@@ -184,8 +195,12 @@ macro_rules! tool_check_step {
184195
};
185196
}
186197

187-
tool_check_step!(Rustdoc, "src/tools/rustdoc");
188-
tool_check_step!(Clippy, "src/tools/clippy");
198+
tool_check_step!(Rustdoc, "src/tools/rustdoc", SourceType::InTree);
199+
// Clippy is a hybrid. It is an external tool, but uses a git subtree instead
200+
// of a submodule. Since the SourceType only drives the deny-warnings
201+
// behavior, treat it as in-tree so that any new warnings in clippy will be
202+
// rejected.
203+
tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree);
189204

190205
/// Cargo's output path for the standard library in a given stage, compiled
191206
/// by a particular compiler for the specified target.

src/bootstrap/compile.rs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ use filetime::FileTime;
2020
use serde::Deserialize;
2121

2222
use crate::builder::Cargo;
23+
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
24+
use crate::cache::{Interned, INTERNER};
2325
use crate::dist;
2426
use crate::native;
27+
use crate::tool::SourceType;
2528
use crate::util::{exe, is_dylib, symlink_dir};
2629
use crate::{Compiler, DependencyType, GitRepo, Mode};
2730

28-
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
29-
use crate::cache::{Interned, INTERNER};
30-
3131
#[derive(Debug, PartialOrd, Ord, Copy, Clone, PartialEq, Eq, Hash)]
3232
pub struct Std {
3333
pub target: Interned<String>,
@@ -87,7 +87,7 @@ impl Step for Std {
8787
target_deps.extend(copy_third_party_objects(builder, &compiler, target));
8888
target_deps.extend(copy_self_contained_objects(builder, &compiler, target));
8989

90-
let mut cargo = builder.cargo(compiler, Mode::Std, target, "build");
90+
let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build");
9191
std_cargo(builder, target, compiler.stage, &mut cargo);
9292

9393
builder.info(&format!(
@@ -131,26 +131,13 @@ fn copy_third_party_objects(
131131
compiler: &Compiler,
132132
target: Interned<String>,
133133
) -> Vec<(PathBuf, DependencyType)> {
134-
let libdir = builder.sysroot_libdir(*compiler, target);
135134
let mut target_deps = vec![];
136135

137-
// Copies libunwind.a compiled to be linked with x86_64-fortanix-unknown-sgx.
138-
//
139-
// This target needs to be linked to Fortanix's port of llvm's libunwind.
140-
// libunwind requires support for rwlock and printing to stderr,
141-
// which is provided by std for this target.
136+
// FIXME: remove this in 2021
142137
if target == "x86_64-fortanix-unknown-sgx" {
143-
let src_path_env = "X86_FORTANIX_SGX_LIBS";
144-
let src =
145-
env::var(src_path_env).unwrap_or_else(|_| panic!("{} not found in env", src_path_env));
146-
copy_and_stamp(
147-
builder,
148-
&*libdir,
149-
Path::new(&src),
150-
"libunwind.a",
151-
&mut target_deps,
152-
DependencyType::Target,
153-
);
138+
if env::var_os("X86_FORTANIX_SGX_LIBS").is_some() {
139+
builder.info("Warning: X86_FORTANIX_SGX_LIBS environment variable is ignored, libunwind is now compiled as part of rustbuild");
140+
}
154141
}
155142

156143
if builder.config.sanitizers && compiler.stage != 0 {
@@ -513,7 +500,7 @@ impl Step for Rustc {
513500
target: builder.config.build,
514501
});
515502

516-
let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "build");
503+
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "build");
517504
rustc_cargo(builder, &mut cargo, target);
518505

519506
builder.info(&format!(

src/bootstrap/doc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ impl Step for Std {
435435
t!(fs::copy(builder.src.join("src/doc/rust.css"), out.join("rust.css")));
436436

437437
let run_cargo_rustdoc_for = |package: &str| {
438-
let mut cargo = builder.cargo(compiler, Mode::Std, target, "rustdoc");
438+
let mut cargo =
439+
builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "rustdoc");
439440
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
440441

441442
// Keep a whitelist so we do not build internal stdlib crates, these will be
@@ -534,7 +535,7 @@ impl Step for Rustc {
534535
t!(symlink_dir_force(&builder.config, &out, &out_dir));
535536

536537
// Build cargo command.
537-
let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "doc");
538+
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "doc");
538539
cargo.env(
539540
"RUSTDOCFLAGS",
540541
"--document-private-items \

0 commit comments

Comments
 (0)