compiler: always use var_os("RUST_BACKTRACE")
There are 3 instances of var(...) and 3 instances of var_os(...); the latter avoids an appearance of unhandled error, so use it everywhere.
This commit is contained in:
parent
d4ba2b4c7c
commit
7654d4b398
2 changed files with 3 additions and 3 deletions
|
@ -55,7 +55,7 @@ enum CodegenBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
if env::var("RUST_BACKTRACE").is_err() {
|
if env::var_os("RUST_BACKTRACE").is_none() {
|
||||||
env::set_var("RUST_BACKTRACE", "1");
|
env::set_var("RUST_BACKTRACE", "1");
|
||||||
}
|
}
|
||||||
env::set_var("CG_CLIF_DISABLE_INCR_CACHE", "1");
|
env::set_var("CG_CLIF_DISABLE_INCR_CACHE", "1");
|
||||||
|
|
|
@ -1287,7 +1287,7 @@ pub fn ice_path() -> &'static Option<PathBuf> {
|
||||||
if !rustc_feature::UnstableFeatures::from_environment(None).is_nightly_build() {
|
if !rustc_feature::UnstableFeatures::from_environment(None).is_nightly_build() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
if let Ok("0") = std::env::var("RUST_BACKTRACE").as_deref() {
|
if let Some(s) = std::env::var_os("RUST_BACKTRACE") && s == "0" {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let mut path = match std::env::var("RUSTC_ICE").as_deref() {
|
let mut path = match std::env::var("RUSTC_ICE").as_deref() {
|
||||||
|
@ -1322,7 +1322,7 @@ pub fn install_ice_hook(bug_report_url: &'static str, extra_info: fn(&Handler))
|
||||||
// by the user. Compiler developers and other rustc users can
|
// by the user. Compiler developers and other rustc users can
|
||||||
// opt in to less-verbose backtraces by manually setting "RUST_BACKTRACE"
|
// opt in to less-verbose backtraces by manually setting "RUST_BACKTRACE"
|
||||||
// (e.g. `RUST_BACKTRACE=1`)
|
// (e.g. `RUST_BACKTRACE=1`)
|
||||||
if std::env::var("RUST_BACKTRACE").is_err() {
|
if std::env::var_os("RUST_BACKTRACE").is_none() {
|
||||||
std::env::set_var("RUST_BACKTRACE", "full");
|
std::env::set_var("RUST_BACKTRACE", "full");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue