@@ -214,7 +214,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
214214 self . allocate_raw_ptr ( alloc, kind) . unwrap ( )
215215 }
216216
217- /// This can fail only of `alloc` contains relocations .
217+ /// This can fail only of `alloc` contains provenance .
218218 pub fn allocate_raw_ptr (
219219 & mut self ,
220220 alloc : Allocation ,
@@ -794,10 +794,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
794794 todo. extend ( static_roots) ;
795795 while let Some ( id) = todo. pop ( ) {
796796 if reachable. insert ( id) {
797- // This is a new allocation, add its relocations to `todo`.
797+ // This is a new allocation, add the allocation it points to to `todo`.
798798 if let Some ( ( _, alloc) ) = self . memory . alloc_map . get ( id) {
799799 todo. extend (
800- alloc. relocations ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) ,
800+ alloc. provenance ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) ,
801801 ) ;
802802 }
803803 }
@@ -833,7 +833,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
833833 allocs_to_print : & mut VecDeque < AllocId > ,
834834 alloc : & Allocation < Prov , Extra > ,
835835 ) -> std:: fmt:: Result {
836- for alloc_id in alloc. relocations ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) {
836+ for alloc_id in alloc. provenance ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) {
837837 allocs_to_print. push_back ( alloc_id) ;
838838 }
839839 write ! ( fmt, "{}" , display_allocation( tcx, alloc) )
@@ -960,9 +960,9 @@ impl<'tcx, 'a, Prov: Provenance, Extra> AllocRef<'a, 'tcx, Prov, Extra> {
960960 . map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?)
961961 }
962962
963- /// Returns whether the allocation has relocations for the entire range of the `AllocRef`.
964- pub ( crate ) fn has_relocations ( & self ) -> bool {
965- self . alloc . has_relocations ( & self . tcx , self . range )
963+ /// Returns whether the allocation has provenance anywhere in the range of the `AllocRef`.
964+ pub ( crate ) fn has_provenance ( & self ) -> bool {
965+ self . alloc . range_has_provenance ( & self . tcx , self . range )
966966 }
967967}
968968
@@ -1078,17 +1078,17 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
10781078 return Ok ( ( ) ) ;
10791079 } ;
10801080
1081- // This checks relocation edges on the src, which needs to happen before
1082- // `prepare_relocation_copy `.
1081+ // This checks provenance edges on the src, which needs to happen before
1082+ // `prepare_provenance_copy `.
10831083 let src_bytes = src_alloc
10841084 . get_bytes_with_uninit_and_ptr ( & tcx, src_range)
10851085 . map_err ( |e| e. to_interp_error ( src_alloc_id) ) ?
10861086 . as_ptr ( ) ; // raw ptr, so we can also get a ptr to the destination allocation
1087- // first copy the relocations to a temporary buffer, because
1088- // `get_bytes_mut` will clear the relocations , which is correct,
1089- // since we don't want to keep any relocations at the target.
1090- let relocations =
1091- src_alloc. prepare_relocation_copy ( self , src_range, dest_offset, num_copies) ;
1087+ // first copy the provenance to a temporary buffer, because
1088+ // `get_bytes_mut` will clear the provenance , which is correct,
1089+ // since we don't want to keep any provenance at the target.
1090+ let provenance =
1091+ src_alloc. prepare_provenance_copy ( self , src_range, dest_offset, num_copies) ;
10921092 // Prepare a copy of the initialization mask.
10931093 let compressed = src_alloc. compress_uninit_range ( src_range) ;
10941094
@@ -1117,7 +1117,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11171117 dest_alloc
11181118 . write_uninit ( & tcx, dest_range)
11191119 . map_err ( |e| e. to_interp_error ( dest_alloc_id) ) ?;
1120- // We can forget about the relocations , this is all not initialized anyway.
1120+ // We can forget about the provenance , this is all not initialized anyway.
11211121 return Ok ( ( ) ) ;
11221122 }
11231123
@@ -1161,8 +1161,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11611161 alloc_range ( dest_offset, size) , // just a single copy (i.e., not full `dest_range`)
11621162 num_copies,
11631163 ) ;
1164- // copy the relocations to the destination
1165- dest_alloc. mark_relocation_range ( relocations ) ;
1164+ // copy the provenance to the destination
1165+ dest_alloc. mark_provenance_range ( provenance ) ;
11661166
11671167 Ok ( ( ) )
11681168 }
0 commit comments