Merge pull request #596 from RalfJung/backtrace

move env var stuff out of the miri lib
This commit is contained in:
Oliver Scherer 2019-01-05 14:41:06 +01:00 committed by GitHub
commit cb319b5e42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View file

@ -154,6 +154,14 @@ fn init_late_loggers() {
rustc_driver::init_rustc_env_logger();
}
}
// If MIRI_BACKTRACE is set and RUST_CTFE_BACKTRACE is not, set RUST_CTFE_BACKTRACE.
// Do this late, so we really only apply this to miri's errors.
if let Ok(var) = env::var("MIRI_BACKTRACE") {
if env::var("RUST_CTFE_BACKTRACE") == Err(env::VarError::NotPresent) {
env::set_var("RUST_CTFE_BACKTRACE", &var);
}
}
}
fn find_sysroot() -> String {

View file

@ -15,7 +15,6 @@ extern crate rustc_target;
use std::collections::HashMap;
use std::borrow::Cow;
use std::env;
use rustc::ty::{self, TyCtxt, query::TyCtxtAt};
use rustc::ty::layout::{TyLayout, LayoutOf, Size, Align};
@ -184,14 +183,6 @@ pub fn eval_main<'a, 'tcx: 'a>(
) {
let mut ecx = create_ecx(tcx, main_id, validate).expect("Couldn't create ecx");
// If MIRI_BACKTRACE is set and RUST_CTFE_BACKTRACE is not, set RUST_CTFE_BACKTRACE.
// Do this late, so we really only apply this to miri's errors.
if let Ok(var) = env::var("MIRI_BACKTRACE") {
if env::var("RUST_CTFE_BACKTRACE") == Err(env::VarError::NotPresent) {
env::set_var("RUST_CTFE_BACKTRACE", &var);
}
}
// Run! The main execution.
let res: EvalResult = (|| {
ecx.run()?;