@@ -5,6 +5,7 @@ use std::ffi::OsStr;
5
5
6
6
use rand:: rngs:: StdRng ;
7
7
use rand:: SeedableRng ;
8
+ use log:: info;
8
9
9
10
use rustc_hir:: def_id:: DefId ;
10
11
use rustc_middle:: ty:: { self , layout:: LayoutCx , TyCtxt } ;
@@ -195,8 +196,8 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
195
196
/// Returns `Some(return_code)` if program executed completed.
196
197
/// Returns `None` if an evaluation error occured.
197
198
pub 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 ;
200
201
201
202
let ( mut ecx, ret_place) = match create_ecx ( tcx, main_id, config) {
202
203
Ok ( v) => v,
@@ -244,7 +245,8 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) ->
244
245
match res {
245
246
Ok ( return_code) => {
246
247
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 ) ;
248
250
if leaks != 0 {
249
251
tcx. sess . err ( "the evaluated program leaked memory" ) ;
250
252
// Ignore the provided return code - let the reported error
0 commit comments