1
Fork 0

Update compiler/rustc_const_eval/src/interpret/step.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
scottmcm 2024-12-13 15:27:20 -08:00 committed by GitHub
parent 38249be509
commit d2a98f7638
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -258,7 +258,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
&& span.desugaring_kind() != Some(DesugaringKind::IndexBoundsCheckReborrow) && span.desugaring_kind() != Some(DesugaringKind::IndexBoundsCheckReborrow)
{ {
// If this was not already raw, it needs retagging. // If this was not already raw, it needs retagging.
// Unless it's the `PtrMetadata(&raw const *_n)` from indexing. // As a special hack, we exclude the desugared `PtrMetadata(&raw const *_n)`
// from indexing. (Really we should not do any retag on `&raw` but that does not
// currently work with Stacked Borrows.)
val = M::retag_ptr_value(self, mir::RetagKind::Raw, &val)?; val = M::retag_ptr_value(self, mir::RetagKind::Raw, &val)?;
} }
self.write_immediate(*val, &dest)?; self.write_immediate(*val, &dest)?;