@@ -857,6 +857,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
857857
858858/// Reading and writing.
859859impl < ' tcx , ' a , Tag : Provenance , Extra > AllocRefMut < ' a , ' tcx , Tag , Extra > {
860+ /// `range` is relative to this allocation reference, not the base of the allocation.
860861 pub fn write_scalar (
861862 & mut self ,
862863 range : AllocRange ,
@@ -870,6 +871,7 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
870871 . map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?)
871872 }
872873
874+ /// `offset` is relative to this allocation reference, not the base of the allocation.
873875 pub fn write_ptr_sized (
874876 & mut self ,
875877 offset : Size ,
@@ -888,6 +890,7 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
888890}
889891
890892impl < ' tcx , ' a , Tag : Provenance , Extra > AllocRef < ' a , ' tcx , Tag , Extra > {
893+ /// `range` is relative to this allocation reference, not the base of the allocation.
891894 pub fn read_scalar (
892895 & self ,
893896 range : AllocRange ,
@@ -902,21 +905,20 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRef<'a, 'tcx, Tag, Extra> {
902905 Ok ( res)
903906 }
904907
905- pub fn read_integer (
906- & self ,
907- offset : Size ,
908- size : Size ,
909- ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
910- self . read_scalar ( alloc_range ( offset, size) , /*read_provenance*/ false )
908+ /// `range` is relative to this allocation reference, not the base of the allocation.
909+ pub fn read_integer ( & self , range : AllocRange ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
910+ self . read_scalar ( range, /*read_provenance*/ false )
911911 }
912912
913+ /// `offset` is relative to this allocation reference, not the base of the allocation.
913914 pub fn read_pointer ( & self , offset : Size ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
914915 self . read_scalar (
915916 alloc_range ( offset, self . tcx . data_layout ( ) . pointer_size ) ,
916917 /*read_provenance*/ true ,
917918 )
918919 }
919920
921+ /// `range` is relative to this allocation reference, not the base of the allocation.
920922 pub fn check_bytes (
921923 & self ,
922924 range : AllocRange ,
0 commit comments