@@ -60,7 +60,10 @@ impl MachineStopType for TerminationInfo {}
60
60
61
61
/// Miri specific diagnostics
62
62
pub enum NonHaltingDiagnostic {
63
- CreatedPointerTag ( NonZeroU64 , Option < ( AllocId , AllocRange ) > ) ,
63
+ /// (new_tag, new_kind, (alloc_id, base_offset, orig_tag))
64
+ ///
65
+ /// new_kind is `None` for base tags.
66
+ CreatedPointerTag ( NonZeroU64 , Option < String > , Option < ( AllocId , AllocRange , ProvenanceExtra ) > ) ,
64
67
/// This `Item` was popped from the borrow stack, either due to an access with the given tag or
65
68
/// a deallocation when the second argument is `None`.
66
69
PoppedPointerTag ( Item , Option < ( ProvenanceExtra , AccessKind ) > ) ,
@@ -376,7 +379,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
376
379
MiriInterpCx :: generate_stacktrace_from_stack ( self . threads . active_thread_stack ( ) ) ;
377
380
let ( stacktrace, _was_pruned) = prune_stacktrace ( stacktrace, self ) ;
378
381
379
- let ( title, diag_level) = match e {
382
+ let ( title, diag_level) = match & e {
380
383
RejectedIsolatedOp ( _) => ( "operation rejected by isolation" , DiagLevel :: Warning ) ,
381
384
Int2Ptr { .. } => ( "integer-to-pointer cast" , DiagLevel :: Warning ) ,
382
385
CreatedPointerTag ( ..)
@@ -388,10 +391,13 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
388
391
| WeakMemoryOutdatedLoad => ( "tracking was triggered" , DiagLevel :: Note ) ,
389
392
} ;
390
393
391
- let msg = match e {
392
- CreatedPointerTag ( tag, None ) => format ! ( "created tag {tag:?}" ) ,
393
- CreatedPointerTag ( tag, Some ( ( alloc_id, range) ) ) =>
394
- format ! ( "created tag {tag:?} at {alloc_id:?}{range:?}" ) ,
394
+ let msg = match & e {
395
+ CreatedPointerTag ( tag, None , _) => format ! ( "created base tag {tag:?}" ) ,
396
+ CreatedPointerTag ( tag, Some ( kind) , None ) => format ! ( "created {tag:?} for {kind}" ) ,
397
+ CreatedPointerTag ( tag, Some ( kind) , Some ( ( alloc_id, range, orig_tag) ) ) =>
398
+ format ! (
399
+ "created tag {tag:?} for {kind} at {alloc_id:?}{range:?} derived from {orig_tag:?}"
400
+ ) ,
395
401
PoppedPointerTag ( item, tag) =>
396
402
match tag {
397
403
None => format ! ( "popped tracked tag for item {item:?} due to deallocation" , ) ,
@@ -418,7 +424,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
418
424
format ! ( "weak memory emulation: outdated value returned from load" ) ,
419
425
} ;
420
426
421
- let notes = match e {
427
+ let notes = match & e {
422
428
ProgressReport { block_count } => {
423
429
// It is important that each progress report is slightly different, since
424
430
// identical diagnostics are being deduplicated.
@@ -427,7 +433,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
427
433
_ => vec ! [ ] ,
428
434
} ;
429
435
430
- let helps = match e {
436
+ let helps = match & e {
431
437
Int2Ptr { details : true } =>
432
438
vec ! [
433
439
(
0 commit comments