@@ -9,7 +9,6 @@ use rustc_middle::ty::layout::FnAbiOf;
99use rustc_middle:: ty:: { self , Instance , Ty } ;
1010use rustc_middle:: { bug, mir, span_bug} ;
1111use rustc_span:: source_map:: Spanned ;
12- use rustc_span:: { DesugaringKind , Span } ;
1312use rustc_target:: callconv:: FnAbi ;
1413use tracing:: { info, instrument, trace} ;
1514
@@ -81,9 +80,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
8180 use rustc_middle:: mir:: StatementKind :: * ;
8281
8382 match & stmt. kind {
84- Assign ( box ( place, rvalue) ) => {
85- self . eval_rvalue_into_place ( rvalue, * place, stmt. source_info . span ) ?
86- }
83+ Assign ( box ( place, rvalue) ) => self . eval_rvalue_into_place ( rvalue, * place) ?,
8784
8885 SetDiscriminant { place, variant_index } => {
8986 let dest = self . eval_place ( * * place) ?;
@@ -162,7 +159,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
162159 & mut self ,
163160 rvalue : & mir:: Rvalue < ' tcx > ,
164161 place : mir:: Place < ' tcx > ,
165- span : Span ,
166162 ) -> InterpResult < ' tcx > {
167163 let dest = self . eval_place ( place) ?;
168164 // FIXME: ensure some kind of non-aliasing between LHS and RHS?
@@ -241,7 +237,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
241237 self . write_immediate ( * val, & dest) ?;
242238 }
243239
244- RawPtr ( _ , place) => {
240+ RawPtr ( kind , place) => {
245241 // Figure out whether this is an addr_of of an already raw place.
246242 let place_base_raw = if place. is_indirect_first_projection ( ) {
247243 let ty = self . frame ( ) . body . local_decls [ place. local ] . ty ;
@@ -254,13 +250,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
254250 let src = self . eval_place ( place) ?;
255251 let place = self . force_allocation ( & src) ?;
256252 let mut val = ImmTy :: from_immediate ( place. to_ref ( self ) , dest. layout ) ;
257- if !place_base_raw
258- && span. desugaring_kind ( ) != Some ( DesugaringKind :: IndexBoundsCheckReborrow )
259- {
260- // If this was not already raw, it needs retagging.
261- // As a special hack, we exclude the desugared `PtrMetadata(&raw const *_n)`
262- // from indexing. (Really we should not do any retag on `&raw` but that does not
263- // currently work with Stacked Borrows.)
253+ if !place_base_raw && !kind. is_fake ( ) {
254+ // If this was not already raw, it needs retagging -- except for "fake"
255+ // raw borrows whose defining property is that they do not get retagged.
264256 val = M :: retag_ptr_value ( self , mir:: RetagKind :: Raw , & val) ?;
265257 }
266258 self . write_immediate ( * val, & dest) ?;
0 commit comments