Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,18 @@ impl Builder<'_> {
cargo.env("UPDATE_EXPECT", "1");
}

if !mode.is_tool() {
cargo.env("RUSTC_FORCE_UNSTABLE", "1");
// Set an environment variable that tells the rustc/rustdoc wrapper
// binary to pass `-Zforce-unstable-if-unmarked` to the real compiler.
match mode {
// Any library crate that's part of the sysroot should be marked unstable
// (including third-party dependencies), unless it uses a staged_api
// `#![stable(..)]` attribute to explicitly mark itself stable.
Mode::Std | Mode::Codegen | Mode::Rustc => {
cargo.env("RUSTC_FORCE_UNSTABLE", "1");
}

// For everything else, crate stability shouldn't matter, so don't set a flag.
Mode::ToolBootstrap | Mode::ToolRustcPrivate | Mode::ToolStd | Mode::ToolTarget => {}
}

if let Some(x) = self.crt_static(target) {
Expand Down
7 changes: 0 additions & 7 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,6 @@ pub enum Mode {
}

impl Mode {
pub fn is_tool(&self) -> bool {
match self {
Mode::ToolBootstrap | Mode::ToolRustcPrivate | Mode::ToolStd | Mode::ToolTarget => true,
Mode::Std | Mode::Codegen | Mode::Rustc => false,
}
}

pub fn must_support_dlopen(&self) -> bool {
match self {
Mode::Std | Mode::Codegen => true,
Expand Down
Loading