about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/step.rs
diff options
context:
space:
mode:
authorscottmcm <scottmcm@users.noreply.github.com>2024-12-13 15:27:20 -0800
committerGitHub <noreply@github.com>2024-12-13 15:27:20 -0800
commitd2a98f76389ccfa8fe0bacd5ac2058204d087504 (patch)
tree7bb2a0a725d35a45873f710dd7da3de991d8cabc /compiler/rustc_const_eval/src/interpret/step.rs
parent38249be509101e87ea4ac10951b1b4ce554f1cc0 (diff)
downloadrust-d2a98f76389ccfa8fe0bacd5ac2058204d087504.tar.gz
rust-d2a98f76389ccfa8fe0bacd5ac2058204d087504.zip
Update compiler/rustc_const_eval/src/interpret/step.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/step.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index f6d2e476738..a26c2eca107 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -258,7 +258,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
                     && span.desugaring_kind() != Some(DesugaringKind::IndexBoundsCheckReborrow)
                 {
                     // 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)?;
                 }
                 self.write_immediate(*val, &dest)?;