diff options
| author | Ralf Jung <post@ralfj.de> | 2023-07-24 11:44:58 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-07-25 14:30:58 +0200 |
| commit | a2bcafa500fa407fa77716ab78b353b7d7daac5d (patch) | |
| tree | 58e593f4394ea240723c4b6aa69a84b2e6ac437a /compiler/rustc_const_eval/src/interpret/operator.rs | |
| parent | a593de4fab309968d305f9c6812c2203d4431464 (diff) | |
| download | rust-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.rs | 4 |
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(()) |
