forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// Checks if we're in a nightly build. | ||
/// | ||
/// The environment variable `CFG_RELEASE_CHANNEL` is set during the rustc bootstrap | ||
/// to "stable", "beta", or "nightly" depending on what toolchain is being built. | ||
/// If we are being built as part of the stable or beta toolchains, we want | ||
/// to disable unstable configuration options. | ||
/// | ||
/// If we're being built by cargo (e.g., `cargo +nightly install rustfmt-nightly`), | ||
/// `CFG_RELEASE_CHANNEL` is not set. As we only support being built against the | ||
/// nightly compiler when installed from crates.io, default to nightly mode. | ||
#[macro_export] | ||
macro_rules! is_nightly_channel { | ||
() => { | ||
option_env!("CFG_RELEASE_CHANNEL").map_or(true, |c| c == "nightly" || c == "dev") | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters