We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dffeea commit 25102ccCopy full SHA for 25102cc
src/release_channel.rs
@@ -8,6 +8,10 @@
8
/// If we're being built by cargo (e.g., `cargo +nightly install rustfmt-nightly`),
9
/// `CFG_RELEASE_CHANNEL` is not set. As we only support being built against the
10
/// nightly compiler when installed from crates.io, default to nightly mode.
11
+///
12
+/// Additionally, the RUSTFMT_BOOTSTRAP environment variable can be set to `1` to
13
+/// allow for use of unstable features when used within the compiler's stage0.
14
pub fn is_nightly() -> bool {
15
option_env!("CFG_RELEASE_CHANNEL").map_or(true, |c| c == "nightly" || c == "dev")
16
+ || std::env::var("RUSTFMT_BOOTSTRAP") == Ok("1".to_string())
17
}
0 commit comments