mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
Inline the is_tool check for setting -Zforce-unstable-if-unmarked
This commit is contained in:
@@ -999,8 +999,18 @@ fn cargo(
|
||||
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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user