From 7a205b2a6e0f0bdfc8343d1a6adb5d6419c855cd Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 13 Dec 2016 16:45:04 +0100 Subject: [PATCH 1/3] always generate MIR for the standard library --- src/bootstrap/bin/rustc.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index 2f674a311fef4..2dcd32fc471c5 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -168,6 +168,15 @@ fn main() { cmd.arg("-C").arg(format!("link-args={}", rpath)); } } + + // Generate MIR for all functions in the Rust libraries + // Since users will never build the stdlib themselves, they can't + // obtain an stdlib with full MIR. Thus we simply emit MIR always + // for the stdlib + // Don't do this for stage0 yet, since always_encode_mir isn't part of it yet + if stage != "0" { + cmd.arg("-Zalways_encode_mir"); + } } // Actually run the compiler! From eb0e3f590fb21911fb453392f73f12dde282e533 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 14 Dec 2016 14:37:44 +0100 Subject: [PATCH 2/3] don't encode mir for stable and beta --- src/bootstrap/bin/rustc.rs | 6 +++++- src/bootstrap/lib.rs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index 2dcd32fc471c5..883a18ae95b9f 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -169,12 +169,16 @@ fn main() { } } + let channel = env::var("RUSTC_CHANNEL").unwrap_or(String::new()); + // Generate MIR for all functions in the Rust libraries // Since users will never build the stdlib themselves, they can't // obtain an stdlib with full MIR. Thus we simply emit MIR always // for the stdlib // Don't do this for stage0 yet, since always_encode_mir isn't part of it yet - if stage != "0" { + // Only do this for the nightly and dev channels, we don't want to increase + // the size of stable libraries, and noone is able to use MIR on stable anyway + if channel != "stable" && channel != "beta" && stage != "0" { cmd.arg("-Zalways_encode_mir"); } } diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index cd80c4298dc41..a19a0a7978ad2 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -491,6 +491,7 @@ impl Build { .env("RUSTC_RPATH", self.config.rust_rpath.to_string()) .env("RUSTDOC", self.out.join("bootstrap/debug/rustdoc")) .env("RUSTDOC_REAL", self.rustdoc(compiler)) + .env("RUSTC_CHANNEL", &self.config.channel) .env("RUSTC_FLAGS", self.rustc_flags(target).join(" ")); // Enable usage of unstable features From 4e94cb0ba0fc97c6b9a282221063f5942effc1f4 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 14 Dec 2016 14:39:40 +0100 Subject: [PATCH 3/3] dashes are canonical --- src/bootstrap/bin/rustc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index 883a18ae95b9f..400973780ed2e 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -179,7 +179,7 @@ fn main() { // Only do this for the nightly and dev channels, we don't want to increase // the size of stable libraries, and noone is able to use MIR on stable anyway if channel != "stable" && channel != "beta" && stage != "0" { - cmd.arg("-Zalways_encode_mir"); + cmd.arg("-Zalways-encode-mir"); } }