about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/operator.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-07-24 11:44:58 +0200
committerRalf Jung <post@ralfj.de>2023-07-25 14:30:58 +0200
commita2bcafa500fa407fa77716ab78b353b7d7daac5d (patch)
tree58e593f4394ea240723c4b6aa69a84b2e6ac437a /compiler/rustc_const_eval/src/interpret/operator.rs
parenta593de4fab309968d305f9c6812c2203d4431464 (diff)
downloadrust-a2bcafa500fa407fa77716ab78b353b7d7daac5d.tar.gz
rust-a2bcafa500fa407fa77716ab78b353b7d7daac5d.zip
interpret: refactor projection code to work on a common trait, and use that for visitors
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/operator.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/operator.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operator.rs b/compiler/rustc_const_eval/src/interpret/operator.rs
index e04764636cc..49c3b152e1d 100644
--- a/compiler/rustc_const_eval/src/interpret/operator.rs
+++ b/compiler/rustc_const_eval/src/interpret/operator.rs
@@ -38,9 +38,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             // With randomized layout, `(int, bool)` might cease to be a `ScalarPair`, so we have to
             // do a component-wise write here. This code path is slower than the above because
             // `place_field` will have to `force_allocate` locals here.
-            let val_field = self.place_field(&dest, 0)?;
+            let val_field = self.project_field(dest, 0)?;
             self.write_scalar(val, &val_field)?;
-            let overflowed_field = self.place_field(&dest, 1)?;
+            let overflowed_field = self.project_field(dest, 1)?;
             self.write_scalar(Scalar::from_bool(overflowed), &overflowed_field)?;
         }
         Ok(())