File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ extern crate syntax;
1313extern crate log;
1414
1515use std:: path:: PathBuf ;
16+ use std:: str:: FromStr ;
1617use std:: env;
1718
1819use rustc:: session:: Session ;
@@ -172,15 +173,14 @@ fn init_late_loggers() {
172173 if env:: var ( "RUST_LOG" ) . is_err ( ) {
173174 // We try to be a bit clever here: If MIRI_LOG is just a single level
174175 // used for everything, we only apply it to the parts of rustc that are
175- // CTFE-related. Only if MIRI_LOG contains `module=level`, we just
176- // use the same value for RUST_LOG.
176+ // CTFE-related. Otherwise, we use it verbatim for RUST_LOG.
177177 // This way, if you set `MIRI_LOG=trace`, you get only the right parts of
178178 // rustc traced, but you can also do `MIRI_LOG=miri=trace,rustc_mir::interpret=debug`.
179- if var. contains ( '=' ) {
180- env:: set_var ( "RUST_LOG" , & var) ;
181- } else {
179+ if log:: Level :: from_str ( & var) . is_ok ( ) {
182180 env:: set_var ( "RUST_LOG" ,
183181 & format ! ( "rustc::mir::interpret={0},rustc_mir::interpret={0}" , var) ) ;
182+ } else {
183+ env:: set_var ( "RUST_LOG" , & var) ;
184184 }
185185 rustc_driver:: init_rustc_env_logger ( ) ;
186186 }
You can’t perform that action at this time.
0 commit comments