File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,21 @@ use file_lines::FileLines;
21
21
use lists:: { ListTactic , SeparatorPlace , SeparatorTactic } ;
22
22
use Summary ;
23
23
24
+ /// Check if we're in a nightly build.
25
+ ///
26
+ /// The environment variable `CFG_RELEASE_CHANNEL` is set during the rustc bootstrap
27
+ /// to "stable", "beta", or "nightly" depending on what toolchain is being built.
28
+ /// If we are being built as part of the stable or beta toolchains, we want
29
+ /// to disable unstable configuration options.
30
+ ///
31
+ /// If we're being built by cargo (e.g. `cargo +nightly install rustfmt-nightly`),
32
+ /// `CFG_RELEASE_CHANNEL` is not set. As we only support being built against the
33
+ /// nightly compiler when installed from crates.io, default to nightly mode.
24
34
macro_rules! is_nightly_channel {
25
35
( ) => {
26
36
option_env!( "CFG_RELEASE_CHANNEL" )
27
37
. map( |c| c == "nightly" )
28
- . unwrap_or( false )
38
+ . unwrap_or( true )
29
39
}
30
40
}
31
41
You can’t perform that action at this time.
0 commit comments