@@ -5,6 +5,7 @@ use std::ffi::OsStr;
55
66use rand:: rngs:: StdRng ;
77use rand:: SeedableRng ;
8+ use log:: info;
89
910use rustc_hir:: def_id:: DefId ;
1011use rustc_middle:: ty:: { self , layout:: LayoutCx , TyCtxt } ;
@@ -195,8 +196,8 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
195196/// Returns `Some(return_code)` if program executed completed.
196197/// Returns `None` if an evaluation error occured.
197198pub fn eval_main < ' tcx > ( tcx : TyCtxt < ' tcx > , main_id : DefId , config : MiriConfig ) -> Option < i64 > {
198- // FIXME: on Windows, we ignore leaks (https://github.com/rust-lang/miri/issues/1302) .
199- let ignore_leaks = config. ignore_leaks || tcx . sess . target . target . target_os == "windows" ;
199+ // Copy setting before we move `config` .
200+ let ignore_leaks = config. ignore_leaks ;
200201
201202 let ( mut ecx, ret_place) = match create_ecx ( tcx, main_id, config) {
202203 Ok ( v) => v,
@@ -244,7 +245,8 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) ->
244245 match res {
245246 Ok ( return_code) => {
246247 if !ignore_leaks {
247- let leaks = ecx. memory . leak_report ( ) ;
248+ info ! ( "Additonal static roots: {:?}" , ecx. machine. static_roots) ;
249+ let leaks = ecx. memory . leak_report ( & ecx. machine . static_roots ) ;
248250 if leaks != 0 {
249251 tcx. sess . err ( "the evaluated program leaked memory" ) ;
250252 // Ignore the provided return code - let the reported error
0 commit comments