about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-11-24 19:09:27 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-04-21 21:34:59 +0000
commitddfa2463e205a1bcae51aeb2698f09b4b8288e3d (patch)
tree487800ef8affe998dcbe5672d3f2f471e2a054f6 /compiler/rustc_const_eval/src/interpret
parent409661936f929b254ffc8adb644cf35d1f9765c4 (diff)
downloadrust-ddfa2463e205a1bcae51aeb2698f09b4b8288e3d.tar.gz
rust-ddfa2463e205a1bcae51aeb2698f09b4b8288e3d.zip
Evaluate place expression in `PlaceMention`.
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index 9a366364e76..f9c15c50513 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -113,8 +113,14 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
 
             Intrinsic(box intrinsic) => self.emulate_nondiverging_intrinsic(intrinsic)?,
 
-            // Statements we do not track.
-            PlaceMention(..) | AscribeUserType(..) => {}
+            // Evaluate the place expression, without reading from it.
+            PlaceMention(box place) => {
+                let _ = self.eval_place(*place)?;
+            }
+
+            // This exists purely to guide borrowck lifetime inference, and does not have
+            // an operational effect.
+            AscribeUserType(..) => {}
 
             // Currently, Miri discards Coverage statements. Coverage statements are only injected
             // via an optional compile time MIR pass and have no side effects. Since Coverage