File tree 1 file changed +12
-1
lines changed
collector/src/compile/benchmark
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,11 @@ impl Benchmark {
332
332
preparation_start. elapsed( ) . as_secs_f64( )
333
333
) ;
334
334
335
+ // We need to hold on to the directories to keep the files alive until
336
+ // the processor post-processes them. We also store them in `ManuallyDrop`
337
+ // so that they are not deleted when an error occurs.
338
+ let mut timing_dirs: Vec < ManuallyDrop < TempDir > > = vec ! [ ] ;
339
+
335
340
let benchmark_start = std:: time:: Instant :: now ( ) ;
336
341
for ( ( backend, profile) , prep_dir) in & target_dirs {
337
342
let backend = * backend;
@@ -408,7 +413,7 @@ impl Benchmark {
408
413
}
409
414
}
410
415
}
411
- drop ( ManuallyDrop :: into_inner ( timing_dir) ) ;
416
+ timing_dirs . push ( timing_dir) ;
412
417
}
413
418
}
414
419
log:: trace!(
@@ -417,6 +422,12 @@ impl Benchmark {
417
422
benchmark_start. elapsed( ) . as_secs_f64( )
418
423
) ;
419
424
processor. postprocess_results ( ) . await ;
425
+
426
+ // Now we can release the directories
427
+ for dir in timing_dirs {
428
+ drop ( ManuallyDrop :: into_inner ( dir) ) ;
429
+ }
430
+
420
431
Ok ( ( ) )
421
432
}
422
433
}
You can’t perform that action at this time.
0 commit comments