Skip to content

Commit fd7110d

Browse files
authored
Merge pull request #128 from Rust-for-Linux/dev/build
build.rs: use `option_env!` to register env variable dependency
2 parents 0ce5e88 + 4f7204b commit fd7110d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66

77
let meta = version_meta().unwrap();
88

9-
let use_feature = meta.channel == Channel::Nightly || std::env::var("RUSTC_BOOTSTRAP").is_ok();
9+
let use_feature = meta.channel == Channel::Nightly || option_env!("RUSTC_BOOTSTRAP").is_some();
1010
if use_feature {
1111
// Use this cfg option to control whether we should enable features that are already stable
1212
// in some new Rust versions, but are available as unstable features in older Rust versions

internal/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fn main() {
55

66
let meta = version_meta().unwrap();
77

8-
let use_feature = meta.channel == Channel::Nightly || std::env::var("RUSTC_BOOTSTRAP").is_ok();
8+
let use_feature = meta.channel == Channel::Nightly || option_env!("RUSTC_BOOTSTRAP").is_some();
99
if use_feature {
1010
println!("cargo:rustc-cfg=USE_RUSTC_FEATURES");
1111
}

0 commit comments

Comments
 (0)