Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #64164

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5a446c1
Fix `window.hashchange is not a function`
fmckeogh Aug 21, 2019
b2b9b81
Account for doc comments coming from proc macros without spans
estebank Aug 27, 2019
7ed542d
add regression test
estebank Aug 27, 2019
5da1123
Update zx_time_t to an i64
tmandry Aug 30, 2019
403701f
Don't try to use /dev/null on Fuchsia
tmandry Aug 30, 2019
7bfa2be
fuchsia: Don't fail to spawn if no stdin exists
tmandry Aug 31, 2019
5f91ad0
fuchsia: Fix default environment behavior when spawning
tmandry Aug 31, 2019
3c4d157
Fix unlock ordering in SGX synchronization primitives
Aug 31, 2019
5e933b4
Add x86_64-linux-kernel target
alex Aug 31, 2019
6ed50f4
Rename test locals to work around LLDB bug
ranweiler Sep 1, 2019
35c9e5f
Fix const_err with `-(-0.0)`
JohnTitor Sep 1, 2019
3a6aada
Add `opt-level` check
JohnTitor Sep 1, 2019
4a0872b
Add `overflow_check` check
JohnTitor Sep 1, 2019
8e9825a
Fix overflow_check
JohnTitor Sep 1, 2019
0cd9c16
Fix condition and tests' flags
JohnTitor Sep 1, 2019
a937d8c
Fix tests again
JohnTitor Sep 1, 2019
46877e2
Fix const eval bug breaking run-pass tests in Miri
wesleywiser Aug 29, 2019
fa893a3
use TokenStream rather than &[TokenTree] for built-in macros
matklad Aug 31, 2019
6136495
use consistent naming for buildin expansion functions
matklad Sep 3, 2019
41deb83
Add compile flag
JohnTitor Sep 4, 2019
a0c186c
remove XID and Pattern_White_Space unicode tables from libcore
matklad Jul 21, 2019
206fe8e
flatten rustc_lexer::character_properties module
matklad Sep 4, 2019
c86ea34
Ensure all warnings are emitted even on warnings=warn
Mark-Simulacrum Sep 2, 2019
fda251b
Rename --warnings=allow to --warnings=warn
Mark-Simulacrum Sep 2, 2019
669c3e3
Thread in-tree information through Mode
Mark-Simulacrum Sep 4, 2019
a2384cb
Move warnings out of rustc wrapper
Mark-Simulacrum Sep 4, 2019
e0630ab
Rollup merge of #62848 - matklad:xid-unicode, r=petrochenkov
Centril Sep 5, 2019
789d9b7
Rollup merge of #63774 - chocol4te:fix_63707, r=GuillaumeGomez
Centril Sep 5, 2019
58b84bf
Rollup merge of #63930 - estebank:rustdoc-ice, r=GuillaumeGomez
Centril Sep 5, 2019
58252da
Rollup merge of #64023 - tmandry:libstd-fuchsia-fixes, r=cramertj
Centril Sep 5, 2019
3c82d1e
Rollup merge of #64030 - jethrogb:jb/sgx-sync-issues, r=alexcrichton
Centril Sep 5, 2019
1294d80
Rollup merge of #64041 - matklad:token-stream-tt, r=petrochenkov
Centril Sep 5, 2019
5102c1e
Rollup merge of #64051 - alex:linux-kernel-module-target, r=joshtriplett
Centril Sep 5, 2019
665c473
Rollup merge of #64052 - ranweiler:debuginfo-boxed-struct-64050, r=al…
Centril Sep 5, 2019
b683631
Rollup merge of #64063 - JohnTitor:fix-const-err, r=oli-obk
Centril Sep 5, 2019
2f8cbfc
Rollup merge of #64098 - Mark-Simulacrum:always-warn, r=alexcrichton
Centril Sep 5, 2019
d43b9f3
Rollup merge of #64100 - wesleywiser:fix_miri_const_eval, r=oli-obk
Centril Sep 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ dependencies = [
name = "fmt_macros"
version = "0.0.0"
dependencies = [
"rustc_lexer",
"syntax_pos",
]

Expand Down Expand Up @@ -2372,7 +2373,7 @@ version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
dependencies = [
"unicode-xid",
"unicode-xid 0.1.0",
]

[[package]]
Expand Down Expand Up @@ -3290,7 +3291,7 @@ dependencies = [
name = "rustc_lexer"
version = "0.1.0"
dependencies = [
"unicode-xid",
"unicode-xid 0.2.0",
]

[[package]]
Expand Down Expand Up @@ -3368,6 +3369,7 @@ dependencies = [
"rustc_apfloat",
"rustc_data_structures",
"rustc_errors",
"rustc_lexer",
"rustc_target",
"serialize",
"smallvec",
Expand Down Expand Up @@ -3976,7 +3978,7 @@ checksum = "641e117d55514d6d918490e47102f7e08d096fdde360247e4a10f7a91a8478d3"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
"unicode-xid 0.1.0",
]

[[package]]
Expand All @@ -3988,7 +3990,7 @@ dependencies = [
"proc-macro2",
"quote",
"syn",
"unicode-xid",
"unicode-xid 0.1.0",
]

[[package]]
Expand Down Expand Up @@ -4017,6 +4019,7 @@ dependencies = [
"log",
"rustc_data_structures",
"rustc_errors",
"rustc_lexer",
"rustc_target",
"smallvec",
"syntax",
Expand Down Expand Up @@ -4532,6 +4535,12 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"

[[package]]
name = "unicode-xid"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"

[[package]]
name = "unicode_categories"
version = "0.1.1"
Expand Down
15 changes: 3 additions & 12 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,9 @@ fn main() {
cmd.arg(format!("-Cdebuginfo={}", debuginfo_level));
}

if env::var_os("RUSTC_DENY_WARNINGS").is_some() &&
env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
// When extending this list, add the new lints to the RUSTFLAGS of the
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
// some code doesn't go through this `rustc` wrapper.
cmd.arg("-Dwarnings");
cmd.arg("-Drust_2018_idioms");
cmd.arg("-Dunused_lifetimes");
if use_internal_lints(crate_name) {
cmd.arg("-Zunstable-options");
cmd.arg("-Drustc::internal");
}
if use_internal_lints(crate_name) {
cmd.arg("-Zunstable-options");
cmd.arg("-Wrustc::internal");
}

if let Some(target) = target {
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,9 @@ def build_bootstrap(self):
target_linker = self.get_toml("linker", build_section)
if target_linker is not None:
env["RUSTFLAGS"] += "-C linker=" + target_linker + " "
env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes "
if self.get_toml("deny-warnings", "rust") != "false":
env["RUSTFLAGS"] += "-Dwarnings -Drust_2018_idioms -Dunused_lifetimes "
env["RUSTFLAGS"] += "-Dwarnings "

env["PATH"] = os.path.join(self.bin_root(), "bin") + \
os.pathsep + env["PATH"]
Expand Down
45 changes: 35 additions & 10 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,9 @@ impl<'a> Builder<'a> {
if cmd == "doc" || cmd == "rustdoc" {
let my_out = match mode {
// This is the intended out directory for compiler documentation.
Mode::Rustc | Mode::ToolRustc | Mode::Codegen => self.compiler_doc_out(target),
Mode::Rustc | Mode::ToolRustc { .. } | Mode::Codegen => {
self.compiler_doc_out(target)
}
_ => self.crate_doc_out(target),
};
let rustdoc = self.rustdoc(compiler);
Expand Down Expand Up @@ -797,8 +799,8 @@ impl<'a> Builder<'a> {
}

match mode {
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {},
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
Mode::Std | Mode::ToolBootstrap { .. } | Mode::ToolStd { .. } => {},
Mode::Rustc | Mode::Codegen | Mode::ToolRustc { .. } => {
// Build proc macros both for the host and the target
if target != compiler.host && cmd != "check" {
cargo.arg("-Zdual-proc-macros");
Expand Down Expand Up @@ -873,6 +875,28 @@ impl<'a> Builder<'a> {
extra_args.push_str("-Zforce-unstable-if-unmarked");
}

match mode {
Mode::ToolStd { in_tree: true } |
Mode::ToolRustc { in_tree: true } |
Mode::ToolBootstrap { in_tree: true } |
Mode::Std |
Mode::Rustc |
Mode::Codegen => {
// When extending this list, add the new lints to the RUSTFLAGS of the
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
// some code doesn't go through this `rustc` wrapper.
extra_args.push_str(" -Wrust_2018_idioms");
extra_args.push_str(" -Wunused_lifetimes");
}
Mode::ToolStd { in_tree: false } |
Mode::ToolRustc { in_tree: false } |
Mode::ToolBootstrap { in_tree: false } => {}
}

if self.config.deny_warnings {
extra_args.push_str(" -Dwarnings");
}

if !extra_args.is_empty() {
cargo.env(
"RUSTFLAGS",
Expand All @@ -891,7 +915,11 @@ impl<'a> Builder<'a> {
// the stage0 build means it uses libraries build by the stage0
// compiler, but for tools we just use the precompiled libraries that
// we've downloaded
let use_snapshot = mode == Mode::ToolBootstrap;
let use_snapshot = if let Mode::ToolBootstrap { .. } = mode {
true
} else {
false
};
assert!(!use_snapshot || stage == 0 || self.local_rebuild);

let maybe_sysroot = self.sysroot(compiler);
Expand Down Expand Up @@ -944,8 +972,9 @@ impl<'a> Builder<'a> {
let debuginfo_level = match mode {
Mode::Rustc | Mode::Codegen => self.config.rust_debuginfo_level_rustc,
Mode::Std => self.config.rust_debuginfo_level_std,
Mode::ToolBootstrap | Mode::ToolStd |
Mode::ToolRustc => self.config.rust_debuginfo_level_tools,
Mode::ToolBootstrap { .. } | Mode::ToolStd { .. } | Mode::ToolRustc { .. } => {
self.config.rust_debuginfo_level_tools
}
};
cargo.env("RUSTC_DEBUGINFO_LEVEL", debuginfo_level.to_string());

Expand Down Expand Up @@ -1031,10 +1060,6 @@ impl<'a> Builder<'a> {

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

if self.config.deny_warnings {
cargo.env("RUSTC_DENY_WARNINGS", "1");
}

// Throughout the build Cargo can execute a number of build scripts
// compiling C/C++ code and we need to pass compilers, archivers, flags, etc
// obtained previously to those build scripts.
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::compile::{run_cargo, std_cargo, rustc_cargo, rustc_cargo_env,
add_to_sysroot};
use crate::builder::{RunConfig, Builder, Kind, ShouldRun, Step};
use crate::tool::{prepare_tool_cargo, SourceType};
use crate::tool::prepare_tool_cargo;
use crate::{Compiler, Mode};
use crate::cache::{INTERNER, Interned};
use std::path::PathBuf;
Expand Down Expand Up @@ -187,11 +187,10 @@ impl Step for Rustdoc {

let mut cargo = prepare_tool_cargo(builder,
compiler,
Mode::ToolRustc,
Mode::ToolRustc { in_tree: true },
target,
cargo_subcommand(builder.kind),
"src/tools/rustdoc",
SourceType::InTree,
&[]);

println!("Checking rustdoc artifacts ({} -> {})", &compiler.host, target);
Expand Down Expand Up @@ -244,6 +243,7 @@ pub fn rustdoc_stamp(
compiler: Compiler,
target: Interned<String>,
) -> PathBuf {
builder.cargo_out(compiler, Mode::ToolRustc, target)
// doesn't really matter whether we're in-tree or not
builder.cargo_out(compiler, Mode::ToolRustc { in_tree: true }, target)
.join(".rustdoc-check.stamp")
}
7 changes: 3 additions & 4 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use build_helper::{t, up_to_date};

use crate::util::symlink_dir;
use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};
use crate::tool::{self, prepare_tool_cargo, Tool, SourceType};
use crate::tool::{self, prepare_tool_cargo, Tool};
use crate::compile;
use crate::cache::{INTERNER, Interned};
use crate::config::Config;
Expand Down Expand Up @@ -633,7 +633,7 @@ impl Step for Rustdoc {
builder.ensure(tool::Rustdoc { compiler: compiler });

// Symlink compiler docs to the output directory of rustdoc documentation.
let out_dir = builder.stage_out(compiler, Mode::ToolRustc)
let out_dir = builder.stage_out(compiler, Mode::ToolRustc { in_tree: true })
.join(target)
.join("doc");
t!(fs::create_dir_all(&out_dir));
Expand All @@ -643,11 +643,10 @@ impl Step for Rustdoc {
let mut cargo = prepare_tool_cargo(
builder,
compiler,
Mode::ToolRustc,
Mode::ToolRustc { in_tree: true },
target,
"doc",
"src/tools/rustdoc",
SourceType::InTree,
&[]
);

Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct Flags {
// This overrides the deny-warnings configuation option,
// which passes -Dwarnings to the compiler invocations.
//
// true => deny, false => allow
// true => deny, false => warn
pub deny_warnings: Option<bool>,
}

Expand Down Expand Up @@ -556,10 +556,10 @@ fn split(s: &[String]) -> Vec<String> {
fn parse_deny_warnings(matches: &getopts::Matches) -> Option<bool> {
match matches.opt_str("warnings").as_ref().map(|v| v.as_str()) {
Some("deny") => Some(true),
Some("allow") => Some(false),
Some("warn") => Some(false),
Some(value) => {
eprintln!(
r#"invalid value for --warnings: {:?}, expected "allow" or "deny""#,
r#"invalid value for --warnings: {:?}, expected "warn" or "deny""#,
value,
);
process::exit(1);
Expand Down
12 changes: 6 additions & 6 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,19 @@ pub enum Mode {
/// "other" here is for miscellaneous sets of tools that are built using the
/// bootstrap compiler in its entirety (target libraries and all).
/// Typically these tools compile with stable Rust.
ToolBootstrap,
ToolBootstrap { in_tree: bool },

/// Compile a tool which uses all libraries we compile (up to rustc).
/// Doesn't use the stage0 compiler libraries like "other", and includes
/// tools like rustdoc, cargo, rls, etc.
ToolStd,
ToolRustc,
ToolStd { in_tree: bool },
ToolRustc { in_tree: bool },
}

impl Mode {
pub fn is_tool(&self) -> bool {
match self {
Mode::ToolBootstrap | Mode::ToolRustc | Mode::ToolStd => true,
Mode::ToolBootstrap { .. } | Mode::ToolRustc { .. } | Mode::ToolStd { .. } => true,
_ => false
}
}
Expand Down Expand Up @@ -528,8 +528,8 @@ impl Build {
Mode::Std => "-std",
Mode::Rustc => "-rustc",
Mode::Codegen => "-codegen",
Mode::ToolBootstrap => "-bootstrap-tools",
Mode::ToolStd | Mode::ToolRustc => "-tools",
Mode::ToolBootstrap { .. } => "-bootstrap-tools",
Mode::ToolStd { .. } | Mode::ToolRustc { .. } => "-tools",
};
self.out.join(&*compiler.host)
.join(format!("stage{}{}", compiler.stage, suffix))
Expand Down
Loading