From 2b6fb66dbdf9f0069f437e3eec7a9703562e6bef Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Thu, 21 Dec 2017 17:49:24 +0100 Subject: [PATCH 1/6] Generate code for const- and inline-fns if -Clink-dead-code is specified. --- src/librustc_mir/monomorphize/item.rs | 2 +- src/librustc_mir/monomorphize/partitioning.rs | 4 ++- src/librustc_trans/base.rs | 8 +++++- src/test/codegen/link-dead-code.rs | 27 +++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/test/codegen/link-dead-code.rs diff --git a/src/librustc_mir/monomorphize/item.rs b/src/librustc_mir/monomorphize/item.rs index c3fb126ea1822..1f463cea7643b 100644 --- a/src/librustc_mir/monomorphize/item.rs +++ b/src/librustc_mir/monomorphize/item.rs @@ -115,7 +115,7 @@ pub trait MonoItemExt<'a, 'tcx>: fmt::Debug { let inline_in_all_cgus = tcx.sess.opts.debugging_opts.inline_in_all_cgus.unwrap_or_else(|| { tcx.sess.opts.optimize != OptLevel::No - }); + }) && !tcx.sess.opts.cg.link_dead_code; match *self.as_mono_item() { MonoItem::Fn(ref instance) => { diff --git a/src/librustc_mir/monomorphize/partitioning.rs b/src/librustc_mir/monomorphize/partitioning.rs index 996195800cef8..11c68a116696b 100644 --- a/src/librustc_mir/monomorphize/partitioning.rs +++ b/src/librustc_mir/monomorphize/partitioning.rs @@ -236,7 +236,9 @@ pub fn partition<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // Next we try to make as many symbols "internal" as possible, so LLVM has // more freedom to optimize. - internalize_symbols(tcx, &mut post_inlining, inlining_map); + if !tcx.sess.opts.cg.link_dead_code { + internalize_symbols(tcx, &mut post_inlining, inlining_map); + } // Finally, sort by codegen unit name, so that we get deterministic results let PostInliningPartitioning { diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs index 7c8479d1a0c3f..7bb81e9da34c2 100644 --- a/src/librustc_trans/base.rs +++ b/src/librustc_trans/base.rs @@ -1021,7 +1021,13 @@ fn collect_and_partition_translation_items<'a, 'tcx>( MonoItemCollectionMode::Lazy } } - None => MonoItemCollectionMode::Lazy + None => { + if tcx.sess.opts.cg.link_dead_code { + MonoItemCollectionMode::Eager + } else { + MonoItemCollectionMode::Lazy + } + } }; let (items, inlining_map) = diff --git a/src/test/codegen/link-dead-code.rs b/src/test/codegen/link-dead-code.rs new file mode 100644 index 0000000000000..9cabcd9157a6a --- /dev/null +++ b/src/test/codegen/link-dead-code.rs @@ -0,0 +1,27 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags:-Clink-dead-code + +#![feature(const_fn)] +#![crate_type = "rlib"] + +// This test makes sure that, when -Clink-dead-code is specified, we generate +// code for functions that would otherwise be skipped. + +// CHECK-LABEL: define hidden i32 @_ZN14link_dead_code8const_fn +const fn const_fn() -> i32 { 1 } + +// CHECK-LABEL: define hidden i32 @_ZN14link_dead_code9inline_fn +#[inline] +fn inline_fn() -> i32 { 2 } + +// CHECK-LABEL: define hidden i32 @_ZN14link_dead_code10private_fn +fn private_fn() -> i32 { 3 } From 8bb363c33ed8ebc17168374c2b4acaad9855e38a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20Jaffr=C3=A9?= Date: Sun, 7 Jan 2018 16:54:05 +0100 Subject: [PATCH 2/6] Try to fix a perf regression by updating log Upgrade `log` to `0.4` in multiple crates. --- src/Cargo.lock | 36 +++++++++++----------- src/librustc/Cargo.toml | 2 +- src/librustc/hir/map/mod.rs | 2 +- src/librustc_back/Cargo.toml | 2 +- src/librustc_borrowck/Cargo.toml | 2 +- src/librustc_const_eval/Cargo.toml | 2 +- src/librustc_data_structures/Cargo.toml | 4 +-- src/librustc_driver/Cargo.toml | 2 +- src/librustc_driver/driver.rs | 4 +-- src/librustc_incremental/Cargo.toml | 2 +- src/librustc_lint/Cargo.toml | 2 +- src/librustc_metadata/Cargo.toml | 2 +- src/librustc_metadata/creader.rs | 2 +- src/librustc_mir/Cargo.toml | 2 +- src/librustc_mir/interpret/eval_context.rs | 2 +- src/librustc_mir/interpret/place.rs | 2 +- src/librustc_passes/Cargo.toml | 2 +- src/librustc_resolve/Cargo.toml | 2 +- src/librustc_save_analysis/Cargo.toml | 2 +- src/librustc_trans/Cargo.toml | 2 +- src/librustc_trans_utils/Cargo.toml | 2 +- src/librustc_typeck/Cargo.toml | 2 +- src/libsyntax/Cargo.toml | 2 +- src/tools/compiletest/Cargo.toml | 2 +- 24 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index 52bfa2ab1090e..a21ad12700b3b 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -373,7 +373,7 @@ dependencies = [ "filetime 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1712,7 +1712,7 @@ dependencies = [ "fmt_macros 0.0.0", "graphviz 0.0.0", "jobserver 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_apfloat 0.0.0", "rustc_back 0.0.0", "rustc_const_math 0.0.0", @@ -1774,7 +1774,7 @@ dependencies = [ name = "rustc_back" version = "0.0.0" dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", "syntax 0.0.0", @@ -1794,7 +1794,7 @@ name = "rustc_borrowck" version = "0.0.0" dependencies = [ "graphviz 0.0.0", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_errors 0.0.0", "rustc_mir 0.0.0", @@ -1807,7 +1807,7 @@ name = "rustc_const_eval" version = "0.0.0" dependencies = [ "arena 0.0.0", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_const_math 0.0.0", "rustc_data_structures 0.0.0", @@ -1837,7 +1837,7 @@ name = "rustc_data_structures" version = "0.0.0" dependencies = [ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot_core 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", @@ -1852,7 +1852,7 @@ dependencies = [ "arena 0.0.0", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "graphviz 0.0.0", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_allocator 0.0.0", "rustc_back 0.0.0", @@ -1893,7 +1893,7 @@ name = "rustc_incremental" version = "0.0.0" dependencies = [ "graphviz 0.0.0", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_data_structures 0.0.0", @@ -1906,7 +1906,7 @@ dependencies = [ name = "rustc_lint" version = "0.0.0" dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_const_eval 0.0.0", "syntax 0.0.0", @@ -1939,7 +1939,7 @@ name = "rustc_metadata" version = "0.0.0" dependencies = [ "flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc_macro 0.0.0", "rustc 0.0.0", "rustc_back 0.0.0", @@ -1958,7 +1958,7 @@ dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "graphviz 0.0.0", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "log_settings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_apfloat 0.0.0", @@ -1988,7 +1988,7 @@ dependencies = [ name = "rustc_passes" version = "0.0.0" dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_const_eval 0.0.0", "rustc_const_math 0.0.0", @@ -2027,7 +2027,7 @@ name = "rustc_resolve" version = "0.0.0" dependencies = [ "arena 0.0.0", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", @@ -2039,7 +2039,7 @@ dependencies = [ name = "rustc_save_analysis" version = "0.0.0" dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rls-data 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", @@ -2058,7 +2058,7 @@ dependencies = [ "cc 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "jobserver 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc-demangle 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2086,7 +2086,7 @@ version = "0.0.0" dependencies = [ "ar 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_back 0.0.0", "rustc_data_structures 0.0.0", @@ -2111,7 +2111,7 @@ version = "0.0.0" dependencies = [ "arena 0.0.0", "fmt_macros 0.0.0", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", "rustc_const_math 0.0.0", "rustc_data_structures 0.0.0", @@ -2413,7 +2413,7 @@ name = "syntax" version = "0.0.0" dependencies = [ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_cratesio_shim 0.0.0", "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml index 9dad3c2031d40..f95dbcf411cba 100644 --- a/src/librustc/Cargo.toml +++ b/src/librustc/Cargo.toml @@ -14,7 +14,7 @@ bitflags = "1.0" fmt_macros = { path = "../libfmt_macros" } graphviz = { path = "../libgraphviz" } jobserver = "0.1" -log = "0.3" +log = "0.4" rustc_apfloat = { path = "../librustc_apfloat" } rustc_back = { path = "../librustc_back" } rustc_const_math = { path = "../librustc_const_math" } diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index 33debf6aeb0dd..b386a0c08b0da 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -1068,7 +1068,7 @@ pub fn map_crate<'hir>(sess: &::session::Session, cmdline_args) }; - if log_enabled!(::log::LogLevel::Debug) { + if log_enabled!(::log::Level::Debug) { // This only makes sense for ordered stores; note the // enumerate to count the number of entries. let (entries_less_1, _) = map.iter().filter(|&x| { diff --git a/src/librustc_back/Cargo.toml b/src/librustc_back/Cargo.toml index 92b024b67d4cc..d864c5bc61054 100644 --- a/src/librustc_back/Cargo.toml +++ b/src/librustc_back/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["dylib"] [dependencies] syntax = { path = "../libsyntax" } serialize = { path = "../libserialize" } -log = "0.3" +log = "0.4" rand = "0.3" [features] diff --git a/src/librustc_borrowck/Cargo.toml b/src/librustc_borrowck/Cargo.toml index 25f02537490fa..8522fe11fe1c7 100644 --- a/src/librustc_borrowck/Cargo.toml +++ b/src/librustc_borrowck/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] test = false [dependencies] -log = "0.3" +log = "0.4" syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } graphviz = { path = "../libgraphviz" } diff --git a/src/librustc_const_eval/Cargo.toml b/src/librustc_const_eval/Cargo.toml index e8d404af4defa..53b8402ab2ad5 100644 --- a/src/librustc_const_eval/Cargo.toml +++ b/src/librustc_const_eval/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] [dependencies] arena = { path = "../libarena" } -log = "0.3" +log = "0.4" rustc = { path = "../librustc" } rustc_const_math = { path = "../librustc_const_math" } rustc_data_structures = { path = "../librustc_data_structures" } diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml index 82075ce1f1f79..23e42f6a672c6 100644 --- a/src/librustc_data_structures/Cargo.toml +++ b/src/librustc_data_structures/Cargo.toml @@ -9,7 +9,7 @@ path = "lib.rs" crate-type = ["dylib"] [dependencies] -log = "0.3" +log = "0.4" serialize = { path = "../libserialize" } cfg-if = "0.1.2" stable_deref_trait = "1.0.0" @@ -17,4 +17,4 @@ parking_lot_core = "0.2.8" [dependencies.parking_lot] version = "0.5" -features = ["nightly"] \ No newline at end of file +features = ["nightly"] diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml index 04c0f9b35184e..4f7bbd7927575 100644 --- a/src/librustc_driver/Cargo.toml +++ b/src/librustc_driver/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["dylib"] [dependencies] arena = { path = "../libarena" } graphviz = { path = "../libgraphviz" } -log = { version = "0.3", features = ["release_max_level_info"] } +log = { version = "0.4", features = ["release_max_level_info"] } env_logger = { version = "0.4", default-features = false } rustc = { path = "../librustc" } rustc_allocator = { path = "../librustc_allocator" } diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index c0bbab35e1e95..51c61005bdd2c 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -253,14 +253,14 @@ pub fn compile_input(sess: &Session, result?; - if log_enabled!(::log::LogLevel::Info) { + if log_enabled!(::log::Level::Info) { println!("Pre-trans"); tcx.print_debug_stats(); } let trans = phase_4_translate_to_llvm::(tcx, rx); - if log_enabled!(::log::LogLevel::Info) { + if log_enabled!(::log::Level::Info) { println!("Post-trans"); tcx.print_debug_stats(); } diff --git a/src/librustc_incremental/Cargo.toml b/src/librustc_incremental/Cargo.toml index b40a1b7c0cb7d..eabc3ab03b194 100644 --- a/src/librustc_incremental/Cargo.toml +++ b/src/librustc_incremental/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] [dependencies] graphviz = { path = "../libgraphviz" } -log = "0.3" +log = "0.4" rand = "0.3" rustc = { path = "../librustc" } rustc_data_structures = { path = "../librustc_data_structures" } diff --git a/src/librustc_lint/Cargo.toml b/src/librustc_lint/Cargo.toml index cebf52d5af7a9..9fee2d54e4752 100644 --- a/src/librustc_lint/Cargo.toml +++ b/src/librustc_lint/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] test = false [dependencies] -log = "0.3" +log = "0.4" rustc = { path = "../librustc" } rustc_const_eval = { path = "../librustc_const_eval" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml index 45f5e9feaf888..a2dcf7f3f83f2 100644 --- a/src/librustc_metadata/Cargo.toml +++ b/src/librustc_metadata/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] [dependencies] flate2 = "1.0" -log = "0.3" +log = "0.4" proc_macro = { path = "../libproc_macro" } rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 58453066cf34b..946eecaa45f7d 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -1051,7 +1051,7 @@ impl<'a> middle::cstore::CrateLoader for CrateLoader<'a> { self.inject_allocator_crate(krate); self.inject_panic_runtime(krate); - if log_enabled!(log::LogLevel::Info) { + if log_enabled!(log::Level::Info) { dump_crates(&self.cstore); } } diff --git a/src/librustc_mir/Cargo.toml b/src/librustc_mir/Cargo.toml index ad64244f7c5af..195335dd64c13 100644 --- a/src/librustc_mir/Cargo.toml +++ b/src/librustc_mir/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["dylib"] [dependencies] bitflags = "1.0" graphviz = { path = "../libgraphviz" } -log = "0.3" +log = "0.4" log_settings = "0.1.1" rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index 89d0e91a7ec86..9074cb04abb12 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -781,7 +781,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { } } - if log_enabled!(::log::LogLevel::Trace) { + if log_enabled!(::log::Level::Trace) { self.dump_local(dest); } diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index 097f769adcf1f..e6607b5bc40ad 100644 --- a/src/librustc_mir/interpret/place.rs +++ b/src/librustc_mir/interpret/place.rs @@ -208,7 +208,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { } }; - if log_enabled!(::log::LogLevel::Trace) { + if log_enabled!(::log::Level::Trace) { self.dump_local(place); } diff --git a/src/librustc_passes/Cargo.toml b/src/librustc_passes/Cargo.toml index d2560c2f8203f..776f330a58bdd 100644 --- a/src/librustc_passes/Cargo.toml +++ b/src/librustc_passes/Cargo.toml @@ -9,7 +9,7 @@ path = "lib.rs" crate-type = ["dylib"] [dependencies] -log = "0.3" +log = "0.4" rustc = { path = "../librustc" } rustc_const_eval = { path = "../librustc_const_eval" } rustc_const_math = { path = "../librustc_const_math" } diff --git a/src/librustc_resolve/Cargo.toml b/src/librustc_resolve/Cargo.toml index ab2d152b724a7..4c8d42cf02f98 100644 --- a/src/librustc_resolve/Cargo.toml +++ b/src/librustc_resolve/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] test = false [dependencies] -log = "0.3" +log = "0.4" syntax = { path = "../libsyntax" } rustc = { path = "../librustc" } arena = { path = "../libarena" } diff --git a/src/librustc_save_analysis/Cargo.toml b/src/librustc_save_analysis/Cargo.toml index d8581f52d0d1b..8b2658b2a88c4 100644 --- a/src/librustc_save_analysis/Cargo.toml +++ b/src/librustc_save_analysis/Cargo.toml @@ -9,7 +9,7 @@ path = "lib.rs" crate-type = ["dylib"] [dependencies] -log = "0.3" +log = "0.4" rustc = { path = "../librustc" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_typeck = { path = "../librustc_typeck" } diff --git a/src/librustc_trans/Cargo.toml b/src/librustc_trans/Cargo.toml index 7b242d2b867b6..79dd57b37f41f 100644 --- a/src/librustc_trans/Cargo.toml +++ b/src/librustc_trans/Cargo.toml @@ -13,7 +13,7 @@ test = false bitflags = "1.0" flate2 = "1.0" jobserver = "0.1.5" -log = "0.3" +log = "0.4" num_cpus = "1.0" rustc = { path = "../librustc" } rustc-demangle = "0.1.4" diff --git a/src/librustc_trans_utils/Cargo.toml b/src/librustc_trans_utils/Cargo.toml index 83f06bff33441..7b9537ee23e23 100644 --- a/src/librustc_trans_utils/Cargo.toml +++ b/src/librustc_trans_utils/Cargo.toml @@ -12,7 +12,7 @@ test = false [dependencies] ar = "0.3.0" flate2 = "1.0" -log = "0.3" +log = "0.4" syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } diff --git a/src/librustc_typeck/Cargo.toml b/src/librustc_typeck/Cargo.toml index c3245842b4256..c7868cc1e9507 100644 --- a/src/librustc_typeck/Cargo.toml +++ b/src/librustc_typeck/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] test = false [dependencies] -log = "0.3" +log = "0.4" syntax = { path = "../libsyntax" } arena = { path = "../libarena" } fmt_macros = { path = "../libfmt_macros" } diff --git a/src/libsyntax/Cargo.toml b/src/libsyntax/Cargo.toml index fb1f300f63cc3..07631e0dcfc1b 100644 --- a/src/libsyntax/Cargo.toml +++ b/src/libsyntax/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["dylib"] [dependencies] bitflags = "1.0" serialize = { path = "../libserialize" } -log = "0.3" +log = "0.4" syntax_pos = { path = "../libsyntax_pos" } rustc_cratesio_shim = { path = "../librustc_cratesio_shim" } rustc_errors = { path = "../librustc_errors" } diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index 494c57b161fea..725c8e75e6ac4 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -8,7 +8,7 @@ diff = "0.1.10" env_logger = { version = "0.4", default-features = false } filetime = "0.1" getopts = "0.2" -log = "0.3" +log = "0.4" regex = "0.2" rustc-serialize = "0.3" From 61016c113e3411c15a798ee7102ebfa5435d061b Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 5 Jan 2018 11:11:30 +0530 Subject: [PATCH 3/6] Make double ended string searchers use dependent fingers (fixes #47175) --- src/libcore/str/pattern.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs index 677c0ecc33d7f..089d691773a1b 100644 --- a/src/libcore/str/pattern.rs +++ b/src/libcore/str/pattern.rs @@ -284,7 +284,7 @@ unsafe impl<'a> Searcher<'a> for CharSearcher<'a> { #[inline] fn next(&mut self) -> SearchStep { let old_finger = self.finger; - let slice = unsafe { self.haystack.get_unchecked(old_finger..self.haystack.len()) }; + let slice = unsafe { self.haystack.get_unchecked(old_finger..self.finger_back) }; let mut iter = slice.chars(); let old_len = iter.iter.len(); if let Some(ch) = iter.next() { @@ -304,7 +304,8 @@ unsafe impl<'a> Searcher<'a> for CharSearcher<'a> { fn next_match(&mut self) -> Option<(usize, usize)> { loop { // get the haystack after the last character found - let bytes = if let Some(slice) = self.haystack.as_bytes().get(self.finger..) { + let bytes = if let Some(slice) = self.haystack.as_bytes() + .get(self.finger..self.finger_back) { slice } else { return None; @@ -340,7 +341,7 @@ unsafe impl<'a> Searcher<'a> for CharSearcher<'a> { } } else { // found nothing, exit - self.finger = self.haystack.len(); + self.finger = self.finger_back; return None; } } @@ -353,7 +354,7 @@ unsafe impl<'a> ReverseSearcher<'a> for CharSearcher<'a> { #[inline] fn next_back(&mut self) -> SearchStep { let old_finger = self.finger_back; - let slice = unsafe { self.haystack.slice_unchecked(0, old_finger) }; + let slice = unsafe { self.haystack.slice_unchecked(self.finger, old_finger) }; let mut iter = slice.chars(); let old_len = iter.iter.len(); if let Some(ch) = iter.next_back() { @@ -374,7 +375,7 @@ unsafe impl<'a> ReverseSearcher<'a> for CharSearcher<'a> { let haystack = self.haystack.as_bytes(); loop { // get the haystack up to but not including the last character searched - let bytes = if let Some(slice) = haystack.get(..self.finger_back) { + let bytes = if let Some(slice) = haystack.get(self.finger..self.finger_back) { slice } else { return None; @@ -382,6 +383,9 @@ unsafe impl<'a> ReverseSearcher<'a> for CharSearcher<'a> { // the last byte of the utf8 encoded needle let last_byte = unsafe { *self.utf8_encoded.get_unchecked(self.utf8_size - 1) }; if let Some(index) = memchr::memrchr(last_byte, bytes) { + // we searched a slice that was offset by self.finger, + // add self.finger to recoup the original index + let index = self.finger + index; // memrchr will return the index of the byte we wish to // find. In case of an ASCII character, this is indeed // were we wish our new finger to be ("after" the found @@ -412,7 +416,7 @@ unsafe impl<'a> ReverseSearcher<'a> for CharSearcher<'a> { // found the last byte when searching in reverse. self.finger_back = index; } else { - self.finger_back = 0; + self.finger_back = self.finger; // found nothing, exit return None; } From ccca24d8a89cd275a5932aa3f6cab9066f3a3e55 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 5 Jan 2018 11:11:39 +0530 Subject: [PATCH 4/6] Regression tests for #47175 --- src/libcore/tests/pattern.rs | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/libcore/tests/pattern.rs b/src/libcore/tests/pattern.rs index d0fd15263b219..cfa3b7ee6640f 100644 --- a/src/libcore/tests/pattern.rs +++ b/src/libcore/tests/pattern.rs @@ -262,3 +262,41 @@ fn test_reverse_search_shared_bytes() { [InRange(37, 40), Rejects(34, 37), InRange(10, 13), Rejects(8, 10), Done] ); } + +#[test] +fn double_ended_regression_test() { + // https://github.com/rust-lang/rust/issues/47175 + // Ensures that double ended searching comes to a convergence + search_asserts!("abcdeabcdeabcde", 'a', "alternating double ended search", + [next_match, next_match_back, next_match, next_match_back], + [InRange(0, 1), InRange(10, 11), InRange(5, 6), Done] + ); + search_asserts!("abcdeabcdeabcde", 'a', "triple double ended search for a", + [next_match, next_match_back, next_match_back, next_match_back], + [InRange(0, 1), InRange(10, 11), InRange(5, 6), Done] + ); + search_asserts!("abcdeabcdeabcde", 'd', "triple double ended search for d", + [next_match, next_match_back, next_match_back, next_match_back], + [InRange(3, 4), InRange(13, 14), InRange(8, 9), Done] + ); + search_asserts!(STRESS, 'Á', "Double ended search for two-byte Latin character", + [next_match, next_match_back, next_match, next_match_back], + [InRange(0, 2), InRange(32, 34), InRange(8, 10), Done] + ); + search_asserts!(STRESS, '각', "Reverse double ended search for three-byte Hangul character", + [next_match_back, next_back, next_match, next, next_match_back, next_match], + [InRange(34, 37), Rejects(32, 34), InRange(19, 22), Rejects(22, 25), InRange(28, 31), Done] + ); + search_asserts!(STRESS, 'āļ', "Double ended search for three-byte Thai character", + [next_match, next_back, next, next_match_back, next_match], + [InRange(22, 25), Rejects(47, 48), Rejects(25, 28), InRange(40, 43), Done] + ); + search_asserts!(STRESS, '😁', "Double ended search for four-byte emoji", + [next_match_back, next, next_match, next_back, next_match], + [InRange(43, 47), Rejects(0, 2), InRange(15, 19), Rejects(40, 43), Done] + ); + search_asserts!(STRESS, 'ꁁ', "Double ended search for three-byte Yi character with repeated bytes", + [next_match, next, next_match_back, next_back, next_match], + [InRange(10, 13), Rejects(13, 14), InRange(37, 40), Rejects(34, 37), Done] + ); +} From cbb547b3ca05d2b5c099a2576ce7fbf147d426a3 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Mon, 8 Jan 2018 12:30:52 +0100 Subject: [PATCH 5/6] Shorten names of some compiler generated artifacts. --- src/librustc/mir/mono.rs | 12 +++++++ src/librustc/session/config.rs | 2 ++ src/librustc_data_structures/base_n.rs | 22 ++++++++----- src/librustc_incremental/persist/fs.rs | 11 ++++--- .../persist/work_product.rs | 4 +-- src/librustc_mir/monomorphize/partitioning.rs | 33 ++++++++++++++----- src/librustc_trans/assert_module_sources.rs | 6 +++- src/librustc_trans/back/bytecode.rs | 2 +- src/librustc_trans/context.rs | 2 +- src/tools/compiletest/src/runtest.rs | 4 +++ 10 files changed, 70 insertions(+), 28 deletions(-) diff --git a/src/librustc/mir/mono.rs b/src/librustc/mir/mono.rs index 5f74f08823783..efdf4066815f4 100644 --- a/src/librustc/mir/mono.rs +++ b/src/librustc/mir/mono.rs @@ -12,9 +12,11 @@ use syntax::ast::NodeId; use syntax::symbol::InternedString; use ty::Instance; use util::nodemap::FxHashMap; +use rustc_data_structures::base_n; use rustc_data_structures::stable_hasher::{HashStable, StableHasherResult, StableHasher}; use ich::{Fingerprint, StableHashingContext, NodeIdHashingMode}; +use std::hash::Hash; #[derive(PartialEq, Eq, Clone, Copy, Debug, Hash)] pub enum MonoItem<'tcx> { @@ -119,6 +121,16 @@ impl<'tcx> CodegenUnit<'tcx> { { &mut self.items } + + pub fn mangle_name(human_readable_name: &str) -> String { + // We generate a 80 bit hash from the name. This should be enough to + // avoid collisions and is still reasonably short for filenames. + let mut hasher = StableHasher::new(); + human_readable_name.hash(&mut hasher); + let hash: u128 = hasher.finish(); + let hash = hash & ((1u128 << 80) - 1); + base_n::encode(hash, base_n::CASE_INSENSITIVE) + } } impl<'tcx> HashStable> for CodegenUnit<'tcx> { diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 6ad9bd94bf25c..a86f079f3bc5f 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1234,6 +1234,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "rewrite operators on i128 and u128 into lang item calls (typically provided \ by compiler-builtins) so translation doesn't need to support them, overriding the default for the current target"), + human_readable_cgu_names: bool = (false, parse_bool, [TRACKED], + "generate human-readable, predictable names for codegen units"), } pub fn default_lib_output() -> CrateType { diff --git a/src/librustc_data_structures/base_n.rs b/src/librustc_data_structures/base_n.rs index cf54229fa7f52..d333b6393b9cc 100644 --- a/src/librustc_data_structures/base_n.rs +++ b/src/librustc_data_structures/base_n.rs @@ -13,18 +13,21 @@ use std::str; -pub const MAX_BASE: u64 = 64; -pub const ALPHANUMERIC_ONLY: u64 = 62; +pub const MAX_BASE: usize = 64; +pub const ALPHANUMERIC_ONLY: usize = 62; +pub const CASE_INSENSITIVE: usize = 36; const BASE_64: &'static [u8; MAX_BASE as usize] = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@$"; #[inline] -pub fn push_str(mut n: u64, base: u64, output: &mut String) { +pub fn push_str(mut n: u128, base: usize, output: &mut String) { debug_assert!(base >= 2 && base <= MAX_BASE); - let mut s = [0u8; 64]; + let mut s = [0u8; 128]; let mut index = 0; + let base = base as u128; + loop { s[index] = BASE_64[(n % base) as usize]; index += 1; @@ -39,16 +42,16 @@ pub fn push_str(mut n: u64, base: u64, output: &mut String) { } #[inline] -pub fn encode(n: u64, base: u64) -> String { - let mut s = String::with_capacity(13); +pub fn encode(n: u128, base: usize) -> String { + let mut s = String::new(); push_str(n, base, &mut s); s } #[test] fn test_encode() { - fn test(n: u64, base: u64) { - assert_eq!(Ok(n), u64::from_str_radix(&encode(n, base), base as u32)); + fn test(n: u128, base: usize) { + assert_eq!(Ok(n), u128::from_str_radix(&encode(n, base), base as u32)); } for base in 2..37 { @@ -57,7 +60,8 @@ fn test_encode() { test(35, base); test(36, base); test(37, base); - test(u64::max_value(), base); + test(u64::max_value() as u128, base); + test(u128::max_value(), base); for i in 0 .. 1_000 { test(i * 983, base); diff --git a/src/librustc_incremental/persist/fs.rs b/src/librustc_incremental/persist/fs.rs index 42b1fcccacef2..f4171f951f407 100644 --- a/src/librustc_incremental/persist/fs.rs +++ b/src/librustc_incremental/persist/fs.rs @@ -137,7 +137,7 @@ const QUERY_CACHE_FILENAME: &'static str = "query-cache.bin"; // or hexadecimal numbers (we want short file and directory names). Since these // numbers will be used in file names, we choose an encoding that is not // case-sensitive (as opposed to base64, for example). -const INT_ENCODE_BASE: u64 = 36; +const INT_ENCODE_BASE: usize = base_n::CASE_INSENSITIVE; pub fn dep_graph_path(sess: &Session) -> PathBuf { in_incr_comp_dir_sess(sess, DEP_GRAPH_FILENAME) @@ -357,7 +357,7 @@ pub fn finalize_session_directory(sess: &Session, svh: Svh) { let mut new_sub_dir_name = String::from(&old_sub_dir_name[.. dash_indices[2] + 1]); // Append the svh - base_n::push_str(svh.as_u64(), INT_ENCODE_BASE, &mut new_sub_dir_name); + base_n::push_str(svh.as_u64() as u128, INT_ENCODE_BASE, &mut new_sub_dir_name); // Create the full path let new_path = incr_comp_session_dir.parent().unwrap().join(new_sub_dir_name); @@ -465,7 +465,7 @@ fn generate_session_dir_path(crate_dir: &Path) -> PathBuf { let directory_name = format!("s-{}-{}-working", timestamp, - base_n::encode(random_number as u64, + base_n::encode(random_number as u128, INT_ENCODE_BASE)); debug!("generate_session_dir_path: directory_name = {}", directory_name); let directory_path = crate_dir.join(directory_name); @@ -599,7 +599,7 @@ fn timestamp_to_string(timestamp: SystemTime) -> String { let duration = timestamp.duration_since(UNIX_EPOCH).unwrap(); let micros = duration.as_secs() * 1_000_000 + (duration.subsec_nanos() as u64) / 1000; - base_n::encode(micros, INT_ENCODE_BASE) + base_n::encode(micros as u128, INT_ENCODE_BASE) } fn string_to_timestamp(s: &str) -> Result { @@ -626,7 +626,8 @@ fn crate_path(sess: &Session, // The full crate disambiguator is really long. 64 bits of it should be // sufficient. let crate_disambiguator = crate_disambiguator.to_fingerprint().to_smaller_hash(); - let crate_disambiguator = base_n::encode(crate_disambiguator, INT_ENCODE_BASE); + let crate_disambiguator = base_n::encode(crate_disambiguator as u128, + INT_ENCODE_BASE); let crate_name = format!("{}-{}", crate_name, crate_disambiguator); incr_dir.join(crate_name) diff --git a/src/librustc_incremental/persist/work_product.rs b/src/librustc_incremental/persist/work_product.rs index f23b8dc85b8bb..879132bcacfcf 100644 --- a/src/librustc_incremental/persist/work_product.rs +++ b/src/librustc_incremental/persist/work_product.rs @@ -35,9 +35,9 @@ pub fn save_trans_partition(sess: &Session, let extension = match kind { WorkProductFileKind::Object => "o", WorkProductFileKind::Bytecode => "bc", - WorkProductFileKind::BytecodeCompressed => "bc-compressed", + WorkProductFileKind::BytecodeCompressed => "bc.z", }; - let file_name = format!("cgu-{}.{}", cgu_name, extension); + let file_name = format!("{}.{}", cgu_name, extension); let path_in_incr_dir = in_incr_comp_dir_sess(sess, &file_name); match link_or_copy(path, &path_in_incr_dir) { Ok(_) => Some((kind, file_name)), diff --git a/src/librustc_mir/monomorphize/partitioning.rs b/src/librustc_mir/monomorphize/partitioning.rs index 11c68a116696b..e899cc072e072 100644 --- a/src/librustc_mir/monomorphize/partitioning.rs +++ b/src/librustc_mir/monomorphize/partitioning.rs @@ -200,7 +200,16 @@ impl<'tcx> CodegenUnitExt<'tcx> for CodegenUnit<'tcx> { } // Anything we can't find a proper codegen unit for goes into this. -const FALLBACK_CODEGEN_UNIT: &'static str = "__rustc_fallback_codegen_unit"; +fn fallback_cgu_name(tcx: TyCtxt) -> InternedString { + const FALLBACK_CODEGEN_UNIT: &'static str = "__rustc_fallback_codegen_unit"; + + if tcx.sess.opts.debugging_opts.human_readable_cgu_names { + Symbol::intern(FALLBACK_CODEGEN_UNIT).as_str() + } else { + Symbol::intern(&CodegenUnit::mangle_name(FALLBACK_CODEGEN_UNIT)).as_str() + } +} + pub fn partition<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>, trans_items: I, @@ -297,7 +306,7 @@ fn place_root_translation_items<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let codegen_unit_name = match characteristic_def_id { Some(def_id) => compute_codegen_unit_name(tcx, def_id, is_volatile), - None => Symbol::intern(FALLBACK_CODEGEN_UNIT).as_str(), + None => fallback_cgu_name(tcx), }; let make_codegen_unit = || { @@ -381,7 +390,7 @@ fn place_root_translation_items<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // always ensure we have at least one CGU; otherwise, if we have a // crate with just types (for example), we could wind up with no CGU if codegen_units.is_empty() { - let codegen_unit_name = Symbol::intern(FALLBACK_CODEGEN_UNIT).as_str(); + let codegen_unit_name = fallback_cgu_name(tcx); codegen_units.insert(codegen_unit_name.clone(), CodegenUnit::new(codegen_unit_name.clone())); } @@ -630,10 +639,10 @@ fn compute_codegen_unit_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // Unfortunately we cannot just use the `ty::item_path` infrastructure here // because we need paths to modules and the DefIds of those are not // available anymore for external items. - let mut mod_path = String::with_capacity(64); + let mut cgu_name = String::with_capacity(64); let def_path = tcx.def_path(def_id); - mod_path.push_str(&tcx.crate_name(def_path.krate).as_str()); + cgu_name.push_str(&tcx.crate_name(def_path.krate).as_str()); for part in tcx.def_path(def_id) .data @@ -644,15 +653,21 @@ fn compute_codegen_unit_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, _ => false, } }) { - mod_path.push_str("-"); - mod_path.push_str(&part.data.as_interned_str()); + cgu_name.push_str("-"); + cgu_name.push_str(&part.data.as_interned_str()); } if volatile { - mod_path.push_str(".volatile"); + cgu_name.push_str(".volatile"); } - return Symbol::intern(&mod_path[..]).as_str(); + let cgu_name = if tcx.sess.opts.debugging_opts.human_readable_cgu_names { + cgu_name + } else { + CodegenUnit::mangle_name(&cgu_name) + }; + + Symbol::intern(&cgu_name[..]).as_str() } fn numbered_codegen_unit_name(crate_name: &str, index: usize) -> InternedString { diff --git a/src/librustc_trans/assert_module_sources.rs b/src/librustc_trans/assert_module_sources.rs index c891bd8aaf44f..0e8af1b951192 100644 --- a/src/librustc_trans/assert_module_sources.rs +++ b/src/librustc_trans/assert_module_sources.rs @@ -28,8 +28,10 @@ //! perturb the reuse results. use rustc::dep_graph::{DepNode, DepConstructor}; +use rustc::mir::mono::CodegenUnit; use rustc::ty::TyCtxt; use syntax::ast; +use syntax_pos::symbol::Symbol; use rustc::ich::{ATTR_PARTITION_REUSED, ATTR_PARTITION_TRANSLATED}; const MODULE: &'static str = "module"; @@ -71,9 +73,11 @@ impl<'a, 'tcx> AssertModuleSource<'a, 'tcx> { } let mname = self.field(attr, MODULE); + let mangled_cgu_name = CodegenUnit::mangle_name(&mname.as_str()); + let mangled_cgu_name = Symbol::intern(&mangled_cgu_name).as_str(); let dep_node = DepNode::new(self.tcx, - DepConstructor::CompileCodegenUnit(mname.as_str())); + DepConstructor::CompileCodegenUnit(mangled_cgu_name)); if let Some(loaded_from_cache) = self.tcx.dep_graph.was_loaded_from_cache(&dep_node) { match (disposition, loaded_from_cache) { diff --git a/src/librustc_trans/back/bytecode.rs b/src/librustc_trans/back/bytecode.rs index 9e4630c08f9f8..212d1aaf055d1 100644 --- a/src/librustc_trans/back/bytecode.rs +++ b/src/librustc_trans/back/bytecode.rs @@ -47,7 +47,7 @@ pub const RLIB_BYTECODE_OBJECT_MAGIC: &'static [u8] = b"RUST_OBJECT"; // The version number this compiler will write to bytecode objects in rlibs pub const RLIB_BYTECODE_OBJECT_VERSION: u8 = 2; -pub const RLIB_BYTECODE_EXTENSION: &str = "bytecode.encoded"; +pub const RLIB_BYTECODE_EXTENSION: &str = "bc.z"; pub fn encode(identifier: &str, bytecode: &[u8]) -> Vec { let mut encoded = Vec::new(); diff --git a/src/librustc_trans/context.rs b/src/librustc_trans/context.rs index d5e71062f74d7..e13ad43c92d5e 100644 --- a/src/librustc_trans/context.rs +++ b/src/librustc_trans/context.rs @@ -572,7 +572,7 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> { let mut name = String::with_capacity(prefix.len() + 6); name.push_str(prefix); name.push_str("."); - base_n::push_str(idx as u64, base_n::ALPHANUMERIC_ONLY, &mut name); + base_n::push_str(idx as u128, base_n::ALPHANUMERIC_ONLY, &mut name); name } diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 3aee88136a1ff..25605cebba0d3 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1513,6 +1513,10 @@ impl<'test> TestCx<'test> { rustc.args(&["-Z", "incremental-queries"]); } + if self.config.mode == CodegenUnits { + rustc.args(&["-Z", "human_readable_cgu_names"]); + } + match self.config.mode { CompileFail | ParseFail | Incremental => { // If we are extracting and matching errors in the new From 6ff413e65f71a8f29ca4528fa411a08b16784c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20Jaffr=C3=A9?= Date: Wed, 10 Jan 2018 18:04:48 +0100 Subject: [PATCH 6/6] Bump beta version to `1.24.0-beta.2` --- src/bootstrap/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index 0485ebe17fb00..7833e6da23814 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -29,7 +29,7 @@ pub const CFG_RELEASE_NUM: &str = "1.24.0"; // An optional number to put after the label, e.g. '.2' -> '-beta.2' // Be sure to make this starts with a dot to conform to semver pre-release // versions (section 9) -pub const CFG_PRERELEASE_VERSION: &str = ".1"; +pub const CFG_PRERELEASE_VERSION: &str = ".2"; pub struct GitInfo { inner: Option,