@@ -178,11 +178,11 @@ impl GlobalStateInner {
178178 id
179179 }
180180
181- pub fn new_frame ( & mut self ) -> FrameExtra {
181+ pub fn new_frame ( & mut self , current_span : & CurrentSpan < ' _ , ' _ , ' _ > ) -> FrameExtra {
182182 let call_id = self . next_call_id ;
183183 trace ! ( "new_frame: Assigning call ID {}" , call_id) ;
184184 if self . tracked_call_ids . contains ( & call_id) {
185- register_diagnostic ( NonHaltingDiagnostic :: CreatedCallId ( call_id) ) ;
185+ current_span . emit_diagnostic ( NonHaltingDiagnostic :: CreatedCallId ( call_id) ) ;
186186 }
187187 self . next_call_id = NonZeroU64 :: new ( call_id. get ( ) + 1 ) . unwrap ( ) ;
188188 FrameExtra { call_id, protected_tags : SmallVec :: new ( ) }
@@ -199,11 +199,11 @@ impl GlobalStateInner {
199199 }
200200 }
201201
202- pub fn base_ptr_tag ( & mut self , id : AllocId ) -> SbTag {
202+ pub fn base_ptr_tag ( & mut self , id : AllocId , current_span : & CurrentSpan < ' _ , ' _ , ' _ > ) -> SbTag {
203203 self . base_ptr_tags . get ( & id) . copied ( ) . unwrap_or_else ( || {
204204 let tag = self . new_ptr ( ) ;
205205 if self . tracked_pointer_tags . contains ( & tag) {
206- register_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag ( tag. 0 , None ) ) ;
206+ current_span . emit_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag ( tag. 0 , None ) ) ;
207207 }
208208 trace ! ( "New allocation {:?} has base tag {:?}" , id, tag) ;
209209 self . base_ptr_tags . try_insert ( id, tag) . unwrap ( ) ;
@@ -572,9 +572,9 @@ impl Stacks {
572572 // not through a pointer). That is, whenever we directly write to a local, this will pop
573573 // everything else off the stack, invalidating all previous pointers,
574574 // and in particular, *all* raw pointers.
575- MemoryKind :: Stack => ( extra. base_ptr_tag ( id) , Permission :: Unique ) ,
575+ MemoryKind :: Stack => ( extra. base_ptr_tag ( id, & current_span ) , Permission :: Unique ) ,
576576 // Everything else is shared by default.
577- _ => ( extra. base_ptr_tag ( id) , Permission :: SharedReadWrite ) ,
577+ _ => ( extra. base_ptr_tag ( id, & current_span ) , Permission :: SharedReadWrite ) ,
578578 } ;
579579 Stacks :: new ( size, perm, base_tag, id, & mut current_span)
580580 }
@@ -674,7 +674,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriEvalContextEx
674674 -> InterpResult < ' tcx > {
675675 let global = this. machine . stacked_borrows . as_ref ( ) . unwrap ( ) . borrow ( ) ;
676676 if global. tracked_pointer_tags . contains ( & new_tag) {
677- register_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag (
677+ this . emit_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag (
678678 new_tag. 0 ,
679679 loc. map ( |( alloc_id, base_offset, _) | ( alloc_id, alloc_range ( base_offset, size) ) ) ,
680680 ) ) ;
0 commit comments