@@ -9,7 +9,6 @@ use rustc_middle::ty::layout::FnAbiOf;
9
9
use rustc_middle:: ty:: { self , Instance , Ty } ;
10
10
use rustc_middle:: { bug, mir, span_bug} ;
11
11
use rustc_span:: source_map:: Spanned ;
12
- use rustc_span:: { DesugaringKind , Span } ;
13
12
use rustc_target:: callconv:: FnAbi ;
14
13
use tracing:: { info, instrument, trace} ;
15
14
@@ -81,9 +80,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
81
80
use rustc_middle:: mir:: StatementKind :: * ;
82
81
83
82
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) ?,
87
84
88
85
SetDiscriminant { place, variant_index } => {
89
86
let dest = self . eval_place ( * * place) ?;
@@ -162,7 +159,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
162
159
& mut self ,
163
160
rvalue : & mir:: Rvalue < ' tcx > ,
164
161
place : mir:: Place < ' tcx > ,
165
- span : Span ,
166
162
) -> InterpResult < ' tcx > {
167
163
let dest = self . eval_place ( place) ?;
168
164
// FIXME: ensure some kind of non-aliasing between LHS and RHS?
@@ -241,7 +237,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
241
237
self . write_immediate ( * val, & dest) ?;
242
238
}
243
239
244
- RawPtr ( _ , place) => {
240
+ RawPtr ( kind , place) => {
245
241
// Figure out whether this is an addr_of of an already raw place.
246
242
let place_base_raw = if place. is_indirect_first_projection ( ) {
247
243
let ty = self . frame ( ) . body . local_decls [ place. local ] . ty ;
@@ -254,13 +250,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
254
250
let src = self . eval_place ( place) ?;
255
251
let place = self . force_allocation ( & src) ?;
256
252
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.
264
256
val = M :: retag_ptr_value ( self , mir:: RetagKind :: Raw , & val) ?;
265
257
}
266
258
self . write_immediate ( * val, & dest) ?;
0 commit comments