Skip to content

Commit d2a98f7

Browse files
scottmcmRalfJung
andauthored
Update compiler/rustc_const_eval/src/interpret/step.rs
Co-authored-by: Ralf Jung <[email protected]>
1 parent 38249be commit d2a98f7

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+3
-1
lines changed

Diff for: compiler/rustc_const_eval/src/interpret/step.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
258258
&& span.desugaring_kind() != Some(DesugaringKind::IndexBoundsCheckReborrow)
259259
{
260260
// If this was not already raw, it needs retagging.
261-
// Unless it's the `PtrMetadata(&raw const *_n)` from indexing.
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.)
262264
val = M::retag_ptr_value(self, mir::RetagKind::Raw, &val)?;
263265
}
264266
self.write_immediate(*val, &dest)?;

0 commit comments

Comments
 (0)