Skip to content

Commit af0e16c

Browse files
committed
rustbuild: Use -Z force-unstable-if-unmarked
1 parent 99f629a commit af0e16c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/bootstrap/bin/rustc.rs

+13
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ fn main() {
194194
// do that we pass a weird flag to the compiler to get it to do
195195
// so. Note that this is definitely a hack, and we should likely
196196
// flesh out rpath support more fully in the future.
197+
//
198+
// FIXME: remove condition after next stage0
197199
if stage != "0" {
198200
cmd.arg("-Z").arg("osx-rpath-install-name");
199201
}
@@ -218,6 +220,17 @@ fn main() {
218220
cmd.arg("-Z").arg("unstable-options");
219221
cmd.arg("-C").arg("target-feature=+crt-static");
220222
}
223+
224+
// Force all crates compiled by this compiler to (a) be unstable and (b)
225+
// allow the `rustc_private` feature to link to other unstable crates
226+
// also in the sysroot.
227+
//
228+
// FIXME: remove condition after next stage0
229+
if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() {
230+
if stage != "0" {
231+
cmd.arg("-Z").arg("force-unstable-if-unmarked");
232+
}
233+
}
221234
}
222235

223236
if verbose > 1 {

src/bootstrap/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ impl Build {
479479
// compiled with debuginfo.
480480
if mode != Mode::Tool {
481481
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
482-
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string());
482+
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string())
483+
.env("RUSTC_FORCE_UNSTABLE", "1");
483484
}
484485

485486
// Enable usage of unstable features
@@ -524,7 +525,9 @@ impl Build {
524525
// the comipiler, libs, and tests are stable and we don't want to make
525526
// their deps unstable (since this would break the first invariant
526527
// above).
527-
if mode != Mode::Tool {
528+
//
529+
// FIXME: remove this after next stage0
530+
if mode != Mode::Tool && stage == 0 {
528531
cargo.env("RUSTBUILD_UNSTABLE", "1");
529532
}
530533

0 commit comments

Comments
 (0)