@@ -8,9 +8,9 @@ use std::num::NonZeroU64;
8
8
use std:: time:: Instant ;
9
9
10
10
use log:: trace;
11
+ use measureme:: { DetachedTiming , EventId , Profiler , StringId } ;
11
12
use rand:: rngs:: StdRng ;
12
13
use rand:: SeedableRng ;
13
- use measureme:: { Profiler , StringId , EventId , DetachedTiming } ;
14
14
15
15
use rustc_data_structures:: fx:: FxHashMap ;
16
16
use rustc_middle:: {
@@ -285,15 +285,13 @@ pub struct Evaluator<'mir, 'tcx> {
285
285
}
286
286
287
287
impl < ' mir , ' tcx > Evaluator < ' mir , ' tcx > {
288
- pub ( crate ) fn new (
289
- config : & MiriConfig ,
290
- layout_cx : LayoutCx < ' tcx , TyCtxt < ' tcx > > ,
291
- ) -> Self {
288
+ pub ( crate ) fn new ( config : & MiriConfig , layout_cx : LayoutCx < ' tcx , TyCtxt < ' tcx > > ) -> Self {
292
289
let layouts =
293
290
PrimitiveLayouts :: new ( layout_cx) . expect ( "Couldn't get layouts of primitive types" ) ;
294
- let profiler = config. measureme_out . as_ref ( ) . map ( |out| {
295
- Profiler :: new ( out) . expect ( "Couldn't create `measureme` profiler" )
296
- } ) ;
291
+ let profiler = config
292
+ . measureme_out
293
+ . as_ref ( )
294
+ . map ( |out| Profiler :: new ( out) . expect ( "Couldn't create `measureme` profiler" ) ) ;
297
295
Evaluator {
298
296
// `env_vars` could be initialized properly here if `Memory` were available before
299
297
// calling this method.
@@ -617,9 +615,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
617
615
let timing = if let Some ( profiler) = ecx. machine . profiler . as_ref ( ) {
618
616
let fn_name = frame. instance . to_string ( ) ;
619
617
let entry = ecx. machine . string_cache . entry ( fn_name. clone ( ) ) ;
620
- let name = entry. or_insert_with ( || {
621
- profiler. alloc_string ( & * fn_name)
622
- } ) ;
618
+ let name = entry. or_insert_with ( || profiler. alloc_string ( & * fn_name) ) ;
623
619
624
620
Some ( profiler. start_recording_interval_event_detached (
625
621
* name,
0 commit comments