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 21 pull requests #55382

Merged
merged 62 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8b097c4
Don't try to promote already promoted out temporaries
oli-obk Oct 4, 2018
7d3d835
replace escape-rust-expr test with dont-show-const-contents
Munksgaard Oct 4, 2018
f97e094
Add compile flags to playground-empty test
Munksgaard Oct 4, 2018
46ccce0
Remove duplicate test line
Munksgaard Oct 5, 2018
5f8dc0d
Fix unneeded-trait-implementations-title test
Munksgaard Oct 5, 2018
a9a26de
Fix redirect.rs test
Munksgaard Oct 5, 2018
28596ad
Fix empty-section.rs test
Munksgaard Oct 5, 2018
e961d39
Add line numbers option to rustdoc
GuillaumeGomez Oct 8, 2018
e8bc04e
Use XPATH notation to match against flattened nodes
Munksgaard Oct 10, 2018
9dbe902
Fix issue-46767 test
Munksgaard Oct 10, 2018
df79da9
Fix typo in deprecated_impls
Munksgaard Oct 10, 2018
a9217e3
Fix typo in issue-13698.rs
Munksgaard Oct 10, 2018
80a6b73
Unimplement ExactSizeIterator
sinkuu Oct 22, 2018
b5336c0
Add a cheap mode for `compute_missing_ctors`.
nnethercote Oct 17, 2018
4f2624c
Fix Rustdoc ICE when checking blanket impls
Aaron1011 Oct 22, 2018
8544db0
Add macro call span when lacking any other span in diagnostic
estebank Oct 23, 2018
ad144ac
Modify invalid macro in expression context diagnostic
estebank Oct 23, 2018
8227a93
Point at macro definition when no rules expect token
estebank Oct 24, 2018
1ab45ec
Point to macro def span instead of whole body
estebank Oct 24, 2018
569228a
Fix link to macros chapter
steveklabnik Oct 24, 2018
f8818cb
Fix incorrect semicolon suggestion
estebank Oct 24, 2018
bbc3cd4
rustbuild: fix remap-debuginfo when building a release
Keruspe Oct 25, 2018
ee26e8e
Update RELEASES.md
frewsxcv Oct 25, 2018
f7629ef
Explain a comment in more detail
oli-obk Oct 25, 2018
4dc0287
Explain why we can encounter a `Goto` terminator that we want to promote
oli-obk Oct 25, 2018
f4fe9b0
Clarify exclusion comment further
oli-obk Oct 25, 2018
2cfd790
List allowed tokens after macro fragments
estebank Oct 24, 2018
ee7f4a2
Grammar nit
oli-obk Oct 25, 2018
fd77500
Clear up nonpromotable const fn call qualification
oli-obk Oct 25, 2018
38d9277
Shrink `Statement`.
nnethercote Oct 25, 2018
a7fbf93
Update mailmap for estebank
estebank Oct 26, 2018
3878d24
Remove redundant clone
sinkuu Oct 25, 2018
ea0c165
Typo fixes in configure_cmake comments
eddyp Oct 26, 2018
4747d83
Extend the impl_stable_hash_for! macro for miri.
goffrie Oct 24, 2018
bc87c71
rustbuild: use configured linker to build boostrap
Keruspe Oct 26, 2018
526dc14
Use `SmallVec` for the queue in `coerce_unsized`.
nnethercote Oct 26, 2018
6b98046
validity: assert that unions are non-empty
RalfJung Oct 26, 2018
68d5fdd
Rollup merge of #54816 - oli-obk:double_promotion, r=alexreg
kennytm Oct 26, 2018
a57ce63
Rollup merge of #54824 - Munksgaard:fix-49713, r=QuietMisdreavus
kennytm Oct 26, 2018
4212896
Rollup merge of #54921 - GuillaumeGomez:line-numbers, r=QuietMisdreavus
kennytm Oct 26, 2018
d83376c
Rollup merge of #55167 - nnethercote:is_missing_ctors_empty, r=varkor
kennytm Oct 26, 2018
46f5045
Rollup merge of #55258 - Aaron1011:fix/rustdoc-blanket, r=GuillaumeGomez
kennytm Oct 26, 2018
b8f977a
bootstrap: Allow for build libstd to have its own codegen-unit setting.
michaelwoerister Oct 22, 2018
9e51b57
Make configure.py handle numeric arguments for `--set` a little better.
michaelwoerister Oct 23, 2018
5dedf0c
CI: Set codegen-units-std=1 for dist builds.
michaelwoerister Oct 23, 2018
54edf32
bootstrap: clean up a few clippy findings
matthiaskrgr Oct 26, 2018
9111fab
Rollup merge of #55271 - sinkuu:traversal_iter, r=matthewjasper
kennytm Oct 26, 2018
c6cd57d
Rollup merge of #55292 - estebank:macro-eof, r=pnkfelix
kennytm Oct 26, 2018
eb74711
Rollup merge of #55298 - estebank:macro-def, r=pnkfelix
kennytm Oct 26, 2018
e897fe7
Rollup merge of #55301 - estebank:macro-allowed, r=petrochenkov
kennytm Oct 26, 2018
9880e29
Rollup merge of #55302 - goffrie:impl-stable-hash, r=varkor
kennytm Oct 26, 2018
5c94daa
Rollup merge of #55325 - rust-lang:steveklabnik-patch-1, r=frewsxcv
kennytm Oct 26, 2018
2e1e8d2
Rollup merge of #55343 - Keruspe:remap-debuginfo-release, r=alexcrichton
kennytm Oct 26, 2018
9c55a4a
Rollup merge of #55346 - nnethercote:shrink-StatementKind, r=nagisa
kennytm Oct 26, 2018
626b496
Rollup merge of #55358 - sinkuu:redundant_clone2, r=estebank
kennytm Oct 26, 2018
0b732fb
Rollup merge of #55370 - estebank:mailmap, r=alexcrichton
kennytm Oct 26, 2018
c5e2238
Rollup merge of #55375 - upstreaming:configure_cmake-comment-typo-fix…
kennytm Oct 26, 2018
477f6f7
Rollup merge of #55378 - Keruspe:bootstrap-linker, r=petrochenkov
kennytm Oct 26, 2018
3faffa2
Rollup merge of #55379 - RalfJung:no-empty-union, r=oli-obk
kennytm Oct 26, 2018
5572f2d
Rollup merge of #55264 - michaelwoerister:single-cgu-std, r=simulacrum
kennytm Oct 26, 2018
5a16579
Rollup merge of #55383 - nnethercote:coerce_unsized-SmallVec, r=david…
kennytm Oct 26, 2018
eb29530
Rollup merge of #55391 - matthiaskrgr:bootstrap_cleanup, r=oli-obk
kennytm Oct 26, 2018
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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Eric Holk <[email protected]> <[email protected]>
Eric Holmes <[email protected]>
Eric Reed <[email protected]> <[email protected]>
Erick Tryzelaar <[email protected]> <[email protected]>
Esteban Küber <[email protected]> <[email protected]> <[email protected]> <[email protected]>
Evgeny Sologubov
Falco Hirschenberger <[email protected]> <[email protected]>
Felix S. Klock II <[email protected]> Felix S Klock II <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Misc
[cargo/5877]: https:/rust-lang/cargo/pull/5877/
[cargo/5878]: https:/rust-lang/cargo/pull/5878/
[cargo/5995]: https:/rust-lang/cargo/pull/5995/
[proc-macros]: https://doc.rust-lang.org/book/2018-edition/ch19-06-macros.html
[proc-macros]: https://doc.rust-lang.org/nightly/book/2018-edition/ch19-06-macros.html

[`Ipv4Addr::BROADCAST`]: https://doc.rust-lang.org/nightly/std/net/struct.Ipv4Addr.html#associatedconstant.BROADCAST
[`Ipv4Addr::LOCALHOST`]: https://doc.rust-lang.org/nightly/std/net/struct.Ipv4Addr.html#associatedconstant.LOCALHOST
Expand Down
4 changes: 4 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@
# compiler.
#codegen-units = 1

# Sets the number of codegen units to build the standard library with,
# regardless of what the codegen-unit setting for the rest of the compiler is.
#codegen-units-std = 1

# Whether or not debug assertions are enabled for the compiler and standard
# library. Also enables compilation of debug! and trace! logging macros.
#debug-assertions = false
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ def build_bootstrap(self):
target_features += ["-crt-static"]
if target_features:
env["RUSTFLAGS"] += "-C target-feature=" + (",".join(target_features)) + " "
target_linker = self.get_toml("linker", build_section)
if target_linker is not None:
env["RUSTFLAGS"] += "-C linker=" + target_linker + " "

env["PATH"] = os.path.join(self.bin_root(), "bin") + \
os.pathsep + env["PATH"]
Expand Down
13 changes: 9 additions & 4 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,10 +1119,15 @@ impl<'a> Builder<'a> {
cargo.arg("-v");
}

// This must be kept before the thinlto check, as we set codegen units
// to 1 forcibly there.
if let Some(n) = self.config.rust_codegen_units {
cargo.env("RUSTC_CODEGEN_UNITS", n.to_string());
match (mode, self.config.rust_codegen_units_std, self.config.rust_codegen_units) {
(Mode::Std, Some(n), _) |
(Mode::Test, Some(n), _) |
(_, _, Some(n)) => {
cargo.env("RUSTC_CODEGEN_UNITS", n.to_string());
}
_ => {
// Don't set anything
}
}

if self.config.rust_optimize {
Expand Down
10 changes: 5 additions & 5 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Step for Std {
if builder.config.keep_stage.contains(&compiler.stage) {
builder.info("Warning: Using a potentially old libstd. This may not behave well.");
builder.ensure(StdLink {
compiler: compiler,
compiler,
target_compiler: compiler,
target,
});
Expand Down Expand Up @@ -358,7 +358,7 @@ impl Step for Test {
if builder.config.keep_stage.contains(&compiler.stage) {
builder.info("Warning: Using a potentially old libtest. This may not behave well.");
builder.ensure(TestLink {
compiler: compiler,
compiler,
target_compiler: compiler,
target,
});
Expand Down Expand Up @@ -480,7 +480,7 @@ impl Step for Rustc {
if builder.config.keep_stage.contains(&compiler.stage) {
builder.info("Warning: Using a potentially old librustc. This may not behave well.");
builder.ensure(RustcLink {
compiler: compiler,
compiler,
target_compiler: compiler,
target,
});
Expand Down Expand Up @@ -816,8 +816,8 @@ fn copy_codegen_backends_to_sysroot(builder: &Builder,
let filename = file.file_name().unwrap().to_str().unwrap();
// change `librustc_codegen_llvm-xxxxxx.so` to `librustc_codegen_llvm-llvm.so`
let target_filename = {
let dash = filename.find("-").unwrap();
let dot = filename.find(".").unwrap();
let dash = filename.find('-').unwrap();
let dot = filename.find('.').unwrap();
format!("{}-{}{}",
&filename[..dash],
backend,
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ pub struct Config {
// rust codegen options
pub rust_optimize: bool,
pub rust_codegen_units: Option<u32>,
pub rust_codegen_units_std: Option<u32>,
pub rust_debug_assertions: bool,
pub rust_debuginfo: bool,
pub rust_debuginfo_lines: bool,
Expand Down Expand Up @@ -294,6 +295,7 @@ impl Default for StringOrBool {
struct Rust {
optimize: Option<bool>,
codegen_units: Option<u32>,
codegen_units_std: Option<u32>,
debug_assertions: Option<bool>,
debuginfo: Option<bool>,
debuginfo_lines: Option<bool>,
Expand Down Expand Up @@ -580,6 +582,8 @@ impl Config {
Some(n) => config.rust_codegen_units = Some(n),
None => {}
}

config.rust_codegen_units_std = rust.codegen_units_std;
}

if let Some(ref t) = toml.target {
Expand Down
13 changes: 12 additions & 1 deletion src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,13 @@ def set(key, value):
targets[target][0] = targets[target][0].replace("x86_64-unknown-linux-gnu", target)


def is_number(value):
try:
float(value)
return True
except:
return False

# Here we walk through the constructed configuration we have from the parsed
# command line arguments. We then apply each piece of configuration by
# basically just doing a `sed` to change the various configuration line to what
Expand All @@ -406,7 +413,11 @@ def to_toml(value):
elif isinstance(value, list):
return '[' + ', '.join(map(to_toml, value)) + ']'
elif isinstance(value, str):
return "'" + value + "'"
# Don't put quotes around numeric values
if is_number(value):
return value
else:
return "'" + value + "'"
else:
raise RuntimeError('no toml')

Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,8 @@ impl Step for Extended {
tarballs.extend(rls_installer.clone());
tarballs.extend(clippy_installer.clone());
tarballs.extend(rustfmt_installer.clone());
tarballs.extend(llvm_tools_installer.clone());
tarballs.extend(lldb_installer.clone());
tarballs.extend(llvm_tools_installer);
tarballs.extend(lldb_installer);
tarballs.push(analysis_installer);
tarballs.push(std_installer);
if builder.config.docs {
Expand Down
19 changes: 9 additions & 10 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ impl Default for Subcommand {
impl Flags {
pub fn parse(args: &[String]) -> Flags {
let mut extra_help = String::new();
let mut subcommand_help = format!(
"\
let mut subcommand_help = String::from("\
Usage: x.py <subcommand> [options] [<paths>...]

Subcommands:
Expand Down Expand Up @@ -365,8 +364,8 @@ Arguments:
}

let cmd = match subcommand.as_str() {
"build" => Subcommand::Build { paths: paths },
"check" => Subcommand::Check { paths: paths },
"build" => Subcommand::Build { paths },
"check" => Subcommand::Check { paths },
"test" => Subcommand::Test {
paths,
bless: matches.opt_present("bless"),
Expand All @@ -386,9 +385,9 @@ Arguments:
paths,
test_args: matches.opt_strs("test-args"),
},
"doc" => Subcommand::Doc { paths: paths },
"doc" => Subcommand::Doc { paths },
"clean" => {
if paths.len() > 0 {
if !paths.is_empty() {
println!("\nclean does not take a path argument\n");
usage(1, &opts, &subcommand_help, &extra_help);
}
Expand All @@ -413,19 +412,19 @@ Arguments:
keep_stage: matches.opt_strs("keep-stage")
.into_iter().map(|j| j.parse().unwrap())
.collect(),
host: split(matches.opt_strs("host"))
host: split(&matches.opt_strs("host"))
.into_iter()
.map(|x| INTERNER.intern_string(x))
.collect::<Vec<_>>(),
target: split(matches.opt_strs("target"))
target: split(&matches.opt_strs("target"))
.into_iter()
.map(|x| INTERNER.intern_string(x))
.collect::<Vec<_>>(),
config: cfg_file,
jobs: matches.opt_str("jobs").map(|j| j.parse().unwrap()),
cmd,
incremental: matches.opt_present("incremental"),
exclude: split(matches.opt_strs("exclude"))
exclude: split(&matches.opt_strs("exclude"))
.into_iter()
.map(|p| p.into())
.collect::<Vec<_>>(),
Expand Down Expand Up @@ -488,7 +487,7 @@ impl Subcommand {
}
}

fn split(s: Vec<String>) -> Vec<String> {
fn split(s: &[String]) -> Vec<String> {
s.iter()
.flat_map(|s| s.split(','))
.map(|s| s.to_string())
Expand Down
10 changes: 5 additions & 5 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,10 @@ impl Build {

let path = match which {
GitRepo::Rustc => {
let sha = self.rust_info.sha().expect("failed to find sha");
let sha = self.rust_sha().unwrap_or(channel::CFG_RELEASE_NUM);
format!("/rustc/{}", sha)
}
GitRepo::Llvm => format!("/rustc/llvm"),
GitRepo::Llvm => String::from("/rustc/llvm"),
};
Some(format!("{}={}", self.src.display(), path))
}
Expand All @@ -783,7 +783,7 @@ impl Build {
fn cflags(&self, target: Interned<String>, which: GitRepo) -> Vec<String> {
// Filter out -O and /O (the optimization flags) that we picked up from
// cc-rs because the build scripts will determine that for themselves.
let mut base = self.cc[&target].args().iter()
let mut base: Vec<String> = self.cc[&target].args().iter()
.map(|s| s.to_string_lossy().into_owned())
.filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
.collect::<Vec<_>>();
Expand All @@ -806,10 +806,10 @@ impl Build {
if let Some(map) = self.debuginfo_map(which) {
let cc = self.cc(target);
if cc.ends_with("clang") || cc.ends_with("gcc") {
base.push(format!("-fdebug-prefix-map={}", map).into());
base.push(format!("-fdebug-prefix-map={}", map));
} else if cc.ends_with("clang-cl.exe") {
base.push("-Xclang".into());
base.push(format!("-fdebug-prefix-map={}", map).into());
base.push(format!("-fdebug-prefix-map={}", map));
}
}
base
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,15 @@ fn configure_cmake(builder: &Builder,
// definitely causes problems since all the env vars are pointing to
// 32-bit libraries.
//
// To hack aroudn this... again... we pass an argument that's
// To hack around this... again... we pass an argument that's
// unconditionally passed in the sccache shim. This'll get CMake to
// correctly diagnose it's doing a 32-bit compilation and LLVM will
// internally configure itself appropriately.
if builder.config.llvm_clang_cl.is_some() && target.contains("i686") {
cfg.env("SCCACHE_EXTRA_ARGS", "-m32");
}

// If ccache is configured we inform the build a little differently hwo
// If ccache is configured we inform the build a little differently how
// to invoke ccache while also invoking our compilers.
} else if let Some(ref ccache) = builder.config.ccache {
cfg.define("CMAKE_C_COMPILER", ccache)
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn check(build: &mut Build) {
// one is present as part of the PATH then that can lead to the system
// being unable to identify the files properly. See
// https:/rust-lang/rust/issues/34959 for more details.
if cfg!(windows) && path.to_string_lossy().contains("\"") {
if cfg!(windows) && path.to_string_lossy().contains('\"') {
panic!("PATH contains invalid character '\"'");
}

Expand Down
22 changes: 11 additions & 11 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ impl Step for RustdocTheme {
fn make_run(run: RunConfig) {
let compiler = run.builder.compiler(run.builder.top_stage, run.host);

run.builder.ensure(RustdocTheme { compiler: compiler });
run.builder.ensure(RustdocTheme { compiler });
}

fn run(self, builder: &Builder) {
Expand Down Expand Up @@ -584,9 +584,9 @@ impl Step for RustdocJS {
});
builder.run(&mut command);
} else {
builder.info(&format!(
builder.info(
"No nodejs found, skipping \"src/test/rustdoc-js\" tests"
));
);
}
}
}
Expand Down Expand Up @@ -653,7 +653,7 @@ impl Step for Tidy {
}

let _folder = builder.fold_output(|| "tidy");
builder.info(&format!("tidy check"));
builder.info("tidy check");
try_run(builder, &mut cmd);
}

Expand Down Expand Up @@ -1052,7 +1052,7 @@ impl Step for Compiletest {
let hostflags = flags.clone();
cmd.arg("--host-rustcflags").arg(hostflags.join(" "));

let mut targetflags = flags.clone();
let mut targetflags = flags;
targetflags.push(format!(
"-Lnative={}",
builder.test_helpers_out(target).display()
Expand Down Expand Up @@ -1168,9 +1168,9 @@ impl Step for Compiletest {
}
}
if suite == "run-make-fulldeps" && !builder.config.llvm_enabled {
builder.info(&format!(
builder.info(
"Ignoring run-make test suite as they generally don't work without LLVM"
));
);
return;
}

Expand Down Expand Up @@ -1692,10 +1692,10 @@ impl Step for Crate {
// The javascript shim implements the syscall interface so that test
// output can be correctly reported.
if !builder.config.wasm_syscall {
builder.info(&format!(
builder.info(
"Libstd was built without `wasm_syscall` feature enabled: \
test output may not be visible."
));
);
}

// On the wasm32-unknown-unknown target we're using LTO which is
Expand Down Expand Up @@ -1891,7 +1891,7 @@ impl Step for Distcheck {

/// Run "distcheck", a 'make check' from a tarball
fn run(self, builder: &Builder) {
builder.info(&format!("Distcheck"));
builder.info("Distcheck");
let dir = builder.out.join("tmp").join("distcheck");
let _ = fs::remove_dir_all(&dir);
t!(fs::create_dir_all(&dir));
Expand Down Expand Up @@ -1919,7 +1919,7 @@ impl Step for Distcheck {
);

// Now make sure that rust-src has all of libstd's dependencies
builder.info(&format!("Distcheck rust-src"));
builder.info("Distcheck rust-src");
let dir = builder.out.join("tmp").join("distcheck-src");
let _ = fs::remove_dir_all(&dir);
t!(fs::create_dir_all(&dir));
Expand Down
Loading