@@ -260,13 +260,7 @@ impl GlobalStateInner {
260
260
kind : MemoryKind ,
261
261
machine : & MiriMachine < ' _ > ,
262
262
) -> AllocState {
263
- let _span = enter_trace_span ! (
264
- "borrow_tracker" ,
265
- borrow_tracker_fun = %"new_allocation" ,
266
- ?id,
267
- ?alloc_size,
268
- ?kind,
269
- ) ;
263
+ let _span = enter_trace_span ! ( borrow_tracker:: new_allocation, ?id, ?alloc_size, ?kind) ;
270
264
match self . borrow_tracker_method {
271
265
BorrowTrackerMethod :: StackedBorrows =>
272
266
AllocState :: StackedBorrows ( Box :: new ( RefCell :: new ( Stacks :: new_allocation (
@@ -287,12 +281,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
287
281
kind : RetagKind ,
288
282
val : & ImmTy < ' tcx > ,
289
283
) -> InterpResult < ' tcx , ImmTy < ' tcx > > {
290
- let _span = enter_trace_span ! (
291
- "borrow_tracker" ,
292
- borrow_tracker_fun = %"retag_ptr_value" ,
293
- ?kind,
294
- ?val. layout,
295
- ) ;
284
+ let _span = enter_trace_span ! ( borrow_tracker:: retag_ptr_value, ?kind, ?val. layout) ;
296
285
let this = self . eval_context_mut ( ) ;
297
286
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
298
287
match method {
@@ -306,12 +295,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
306
295
kind : RetagKind ,
307
296
place : & PlaceTy < ' tcx > ,
308
297
) -> InterpResult < ' tcx > {
309
- let _span = enter_trace_span ! (
310
- "borrow_tracker" ,
311
- borrow_tracker_fun = %"retag_place_contents" ,
312
- ?kind,
313
- ?place,
314
- ) ;
298
+ let _span = enter_trace_span ! ( borrow_tracker:: retag_place_contents, ?kind, ?place) ;
315
299
let this = self . eval_context_mut ( ) ;
316
300
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
317
301
match method {
@@ -321,8 +305,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
321
305
}
322
306
323
307
fn protect_place ( & mut self , place : & MPlaceTy < ' tcx > ) -> InterpResult < ' tcx , MPlaceTy < ' tcx > > {
324
- let _span =
325
- enter_trace_span ! ( "borrow_tracker" , borrow_tracker_fun = %"protect_place" , ?place) ;
308
+ let _span = enter_trace_span ! ( borrow_tracker:: protect_place, ?place) ;
326
309
let this = self . eval_context_mut ( ) ;
327
310
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
328
311
match method {
@@ -332,12 +315,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
332
315
}
333
316
334
317
fn expose_tag ( & self , alloc_id : AllocId , tag : BorTag ) -> InterpResult < ' tcx > {
335
- let _span = enter_trace_span ! (
336
- "borrow_tracker" ,
337
- borrow_tracker_fun = %"expose_tag" ,
338
- alloc_id = alloc_id. 0 ,
339
- tag = tag. 0 ,
340
- ) ;
318
+ let _span: MaybeEnteredTraceSpan =
319
+ enter_trace_span ! ( borrow_tracker:: expose_tag, alloc_id = alloc_id. 0 , tag = tag. 0 ) ;
341
320
let this = self . eval_context_ref ( ) ;
342
321
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
343
322
match method {
@@ -381,7 +360,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
381
360
& self ,
382
361
frame : & Frame < ' tcx , Provenance , FrameExtra < ' tcx > > ,
383
362
) -> InterpResult < ' tcx > {
384
- let _span = enter_trace_span ! ( " borrow_tracker" , borrow_tracker_fun = % " on_stack_pop" ) ;
363
+ let _span = enter_trace_span ! ( borrow_tracker:: on_stack_pop) ;
385
364
let this = self . eval_context_ref ( ) ;
386
365
let borrow_tracker = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) ;
387
366
// The body of this loop needs `borrow_tracker` immutably
@@ -459,11 +438,7 @@ impl AllocState {
459
438
range : AllocRange ,
460
439
machine : & MiriMachine < ' tcx > ,
461
440
) -> InterpResult < ' tcx > {
462
- let _span = enter_trace_span ! (
463
- "borrow_tracker" ,
464
- borrow_tracker_fun = %"before_memory_read" ,
465
- alloc_id = alloc_id. 0
466
- ) ;
441
+ let _span = enter_trace_span ! ( borrow_tracker:: before_memory_read, alloc_id = alloc_id. 0 ) ;
467
442
match self {
468
443
AllocState :: StackedBorrows ( sb) =>
469
444
sb. borrow_mut ( ) . before_memory_read ( alloc_id, prov_extra, range, machine) ,
@@ -485,11 +460,7 @@ impl AllocState {
485
460
range : AllocRange ,
486
461
machine : & MiriMachine < ' tcx > ,
487
462
) -> InterpResult < ' tcx > {
488
- let _span = enter_trace_span ! (
489
- "borrow_tracker" ,
490
- borrow_tracker_fun = %"before_memory_write" ,
491
- alloc_id = alloc_id. 0
492
- ) ;
463
+ let _span = enter_trace_span ! ( borrow_tracker:: before_memory_write, alloc_id = alloc_id. 0 ) ;
493
464
match self {
494
465
AllocState :: StackedBorrows ( sb) =>
495
466
sb. get_mut ( ) . before_memory_write ( alloc_id, prov_extra, range, machine) ,
@@ -511,11 +482,8 @@ impl AllocState {
511
482
size : Size ,
512
483
machine : & MiriMachine < ' tcx > ,
513
484
) -> InterpResult < ' tcx > {
514
- let _span = enter_trace_span ! (
515
- "borrow_tracker" ,
516
- borrow_tracker_fun = %"before_memory_deallocation" ,
517
- alloc_id = alloc_id. 0
518
- ) ;
485
+ let _span =
486
+ enter_trace_span ! ( borrow_tracker:: before_memory_deallocation, alloc_id = alloc_id. 0 ) ;
519
487
match self {
520
488
AllocState :: StackedBorrows ( sb) =>
521
489
sb. get_mut ( ) . before_memory_deallocation ( alloc_id, prov_extra, size, machine) ,
@@ -525,8 +493,7 @@ impl AllocState {
525
493
}
526
494
527
495
pub fn remove_unreachable_tags ( & self , tags : & FxHashSet < BorTag > ) {
528
- let _span =
529
- enter_trace_span ! ( "borrow_tracker" , borrow_tracker_fun = %"remove_unreachable_tags" ) ;
496
+ let _span = enter_trace_span ! ( borrow_tracker:: remove_unreachable_tags) ;
530
497
match self {
531
498
AllocState :: StackedBorrows ( sb) => sb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
532
499
AllocState :: TreeBorrows ( tb) => tb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
@@ -542,8 +509,7 @@ impl AllocState {
542
509
alloc_id : AllocId , // diagnostics
543
510
) -> InterpResult < ' tcx > {
544
511
let _span = enter_trace_span ! (
545
- "borrow_tracker" ,
546
- borrow_tracker_fun = %"release_protector" ,
512
+ borrow_tracker:: release_protector,
547
513
alloc_id = alloc_id. 0 ,
548
514
tag = tag. 0
549
515
) ;
@@ -557,7 +523,7 @@ impl AllocState {
557
523
558
524
impl VisitProvenance for AllocState {
559
525
fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
560
- let _span = enter_trace_span ! ( " borrow_tracker" , borrow_tracker_fun = % " visit_provenance" ) ;
526
+ let _span = enter_trace_span ! ( borrow_tracker:: visit_provenance) ;
561
527
match self {
562
528
AllocState :: StackedBorrows ( sb) => sb. visit_provenance ( visit) ,
563
529
AllocState :: TreeBorrows ( tb) => tb. visit_provenance ( visit) ,
0 commit comments