@@ -230,7 +230,7 @@ impl<'tcx> Stack {
230230 }
231231
232232 if !item. protected ( ) {
233- return Ok ( ( ) ) ;
233+ return interp_ok ( ( ) ) ;
234234 }
235235
236236 // We store tags twice, once in global.protected_tags and once in each call frame.
@@ -252,10 +252,10 @@ impl<'tcx> Stack {
252252 let allowed = matches ! ( cause, ItemInvalidationCause :: Dealloc )
253253 && matches ! ( protector_kind, ProtectorKind :: WeakProtector ) ;
254254 if !allowed {
255- return Err ( dcx. protector_error ( item, protector_kind) . into ( ) ) ;
255+ return Err ( dcx. protector_error ( item, protector_kind) ) . into ( ) ;
256256 }
257257 }
258- Ok ( ( ) )
258+ interp_ok ( ( ) )
259259 }
260260
261261 /// Test if a memory `access` using pointer tagged `tag` is granted.
@@ -295,7 +295,7 @@ impl<'tcx> Stack {
295295 self . pop_items_after ( first_incompatible_idx, |item| {
296296 Stack :: item_invalidated ( & item, global, dcx, ItemInvalidationCause :: Conflict ) ?;
297297 dcx. log_invalidation ( item. tag ( ) ) ;
298- Ok ( ( ) )
298+ interp_ok ( ( ) )
299299 } ) ?;
300300 } else {
301301 // On a read, *disable* all `Unique` above the granting item. This ensures U2 for read accesses.
@@ -316,7 +316,7 @@ impl<'tcx> Stack {
316316 self . disable_uniques_starting_at ( first_incompatible_idx, |item| {
317317 Stack :: item_invalidated ( & item, global, dcx, ItemInvalidationCause :: Conflict ) ?;
318318 dcx. log_invalidation ( item. tag ( ) ) ;
319- Ok ( ( ) )
319+ interp_ok ( ( ) )
320320 } ) ?;
321321 }
322322
@@ -345,7 +345,7 @@ impl<'tcx> Stack {
345345 }
346346
347347 // Done.
348- Ok ( ( ) )
348+ interp_ok ( ( ) )
349349 }
350350
351351 /// Deallocate a location: Like a write access, but also there must be no
@@ -367,7 +367,7 @@ impl<'tcx> Stack {
367367 Stack :: item_invalidated ( & item, global, dcx, ItemInvalidationCause :: Dealloc ) ?;
368368 }
369369
370- Ok ( ( ) )
370+ interp_ok ( ( ) )
371371 }
372372
373373 /// Derive a new pointer from one with the given tag.
@@ -418,7 +418,7 @@ impl<'tcx> Stack {
418418 "reborrow: forgetting stack entirely due to SharedReadWrite reborrow from wildcard or unknown"
419419 ) ;
420420 self . set_unknown_bottom ( global. next_ptr_tag ) ;
421- return Ok ( ( ) ) ;
421+ return interp_ok ( ( ) ) ;
422422 } ;
423423
424424 // SharedReadWrite can coexist with "existing loans", meaning they don't act like a write
@@ -431,7 +431,7 @@ impl<'tcx> Stack {
431431 // Put the new item there.
432432 trace ! ( "reborrow: adding item {:?}" , new) ;
433433 self . insert ( new_idx, new) ;
434- Ok ( ( ) )
434+ interp_ok ( ( ) )
435435 }
436436}
437437// # Stacked Borrows Core End
@@ -491,7 +491,7 @@ impl<'tcx> Stacks {
491491 f ( stack, & mut dcx, & mut self . exposed_tags ) ?;
492492 dcx_builder = dcx. unbuild ( ) ;
493493 }
494- Ok ( ( ) )
494+ interp_ok ( ( ) )
495495 }
496496}
497497
@@ -576,7 +576,7 @@ impl Stacks {
576576 self . for_each ( alloc_range ( Size :: ZERO , size) , dcx, |stack, dcx, exposed_tags| {
577577 stack. dealloc ( tag, & state, dcx, exposed_tags)
578578 } ) ?;
579- Ok ( ( ) )
579+ interp_ok ( ( ) )
580580 }
581581}
582582
@@ -623,7 +623,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
623623 drop ( global) ; // don't hold that reference any longer than we have to
624624
625625 let Some ( ( alloc_id, base_offset, orig_tag) ) = loc else {
626- return Ok ( ( ) )
626+ return interp_ok ( ( ) )
627627 } ;
628628
629629 let ( _size, _align, alloc_kind) = this. get_alloc_info ( alloc_id) ;
@@ -655,7 +655,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
655655 // No stacked borrows on these allocations.
656656 }
657657 }
658- Ok ( ( ) )
658+ interp_ok ( ( ) )
659659 } ;
660660
661661 if size == Size :: ZERO {
@@ -676,12 +676,12 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
676676 {
677677 log_creation ( this, Some ( ( alloc_id, base_offset, orig_tag) ) ) ?;
678678 // Still give it the new provenance, it got retagged after all.
679- return Ok ( Some ( Provenance :: Concrete { alloc_id, tag : new_tag } ) ) ;
679+ return interp_ok ( Some ( Provenance :: Concrete { alloc_id, tag : new_tag } ) ) ;
680680 } else {
681681 // This pointer doesn't come with an AllocId. :shrug:
682682 log_creation ( this, None ) ?;
683683 // Provenance unchanged.
684- return Ok ( place. ptr ( ) . provenance ) ;
684+ return interp_ok ( place. ptr ( ) . provenance ) ;
685685 }
686686 }
687687
@@ -800,12 +800,12 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
800800 ) ?;
801801 }
802802 }
803- Ok ( ( ) )
803+ interp_ok ( ( ) )
804804 } ) ?;
805805 }
806806 }
807807
808- Ok ( Some ( Provenance :: Concrete { alloc_id, tag : new_tag } ) )
808+ interp_ok ( Some ( Provenance :: Concrete { alloc_id, tag : new_tag } ) )
809809 }
810810
811811 fn sb_retag_place (
@@ -832,7 +832,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
832832 * shown = true ;
833833 this. emit_diagnostic ( NonHaltingDiagnostic :: ExternTypeReborrow ) ;
834834 } ) ;
835- return Ok ( place. clone ( ) ) ;
835+ return interp_ok ( place. clone ( ) ) ;
836836 }
837837 } ;
838838
@@ -845,7 +845,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
845845 // Adjust place.
846846 // (If the closure gets called, that means the old provenance was `Some`, and hence the new
847847 // one must also be `Some`.)
848- Ok ( place. clone ( ) . map_provenance ( |_| new_prov. unwrap ( ) ) )
848+ interp_ok ( place. clone ( ) . map_provenance ( |_| new_prov. unwrap ( ) ) )
849849 }
850850
851851 /// Retags an individual pointer, returning the retagged version.
@@ -859,7 +859,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
859859 let this = self . eval_context_mut ( ) ;
860860 let place = this. ref_to_mplace ( val) ?;
861861 let new_place = this. sb_retag_place ( & place, new_perm, info) ?;
862- Ok ( ImmTy :: from_immediate ( new_place. to_ref ( this) , val. layout ) )
862+ interp_ok ( ImmTy :: from_immediate ( new_place. to_ref ( this) , val. layout ) )
863863 }
864864}
865865
@@ -917,7 +917,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
917917 in_field : self . in_field ,
918918 } ) ?;
919919 self . ecx . write_immediate ( * val, place) ?;
920- Ok ( ( ) )
920+ interp_ok ( ( ) )
921921 }
922922 }
923923 impl < ' ecx , ' tcx > ValueVisitor < ' tcx , MiriMachine < ' tcx > > for RetagVisitor < ' ecx , ' tcx > {
@@ -935,7 +935,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
935935 let new_perm = NewPermission :: from_box_ty ( place. layout . ty , self . kind , self . ecx ) ;
936936 self . retag_ptr_inplace ( place, new_perm) ?;
937937 }
938- Ok ( ( ) )
938+ interp_ok ( ( ) )
939939 }
940940
941941 fn visit_value ( & mut self , place : & PlaceTy < ' tcx > ) -> InterpResult < ' tcx > {
@@ -944,7 +944,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
944944 // This optimization is crucial for ZSTs, because they can contain way more fields
945945 // than we can ever visit.
946946 if place. layout . is_sized ( ) && place. layout . size < self . ecx . pointer_size ( ) {
947- return Ok ( ( ) ) ;
947+ return interp_ok ( ( ) ) ;
948948 }
949949
950950 // Check the type of this value to see what to do with it (retag, or recurse).
@@ -983,7 +983,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
983983 }
984984 }
985985
986- Ok ( ( ) )
986+ interp_ok ( ( ) )
987987 }
988988 }
989989 }
@@ -1028,7 +1028,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
10281028 // No stacked borrows on these allocations.
10291029 }
10301030 }
1031- Ok ( ( ) )
1031+ interp_ok ( ( ) )
10321032 }
10331033
10341034 fn print_stacks ( & mut self , alloc_id : AllocId ) -> InterpResult < ' tcx > {
@@ -1046,6 +1046,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
10461046 }
10471047 println ! ( " ]" ) ;
10481048 }
1049- Ok ( ( ) )
1049+ interp_ok ( ( ) )
10501050 }
10511051}
0 commit comments