about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/projection.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-16 00:12:54 +0000
committerbors <bors@rust-lang.org>2023-02-16 00:12:54 +0000
commitdc7a676778706bde3b50ff6d4fe81e2955bd4847 (patch)
treedd267ba6f6baeeff00d23d95cde13690bccad0f6 /compiler/rustc_const_eval/src/interpret/projection.rs
parentc5283576ec18937d98889679a54aa8f2dee2b875 (diff)
parent55471015a0238f2fa2bf85adb38eb6bedf5ef26e (diff)
Auto merge of #108096 - matthiaskrgr:rollup-ncexzf6, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #107034 (Migrating rustc_infer to session diagnostics (part 4))
 - #107972 (Fix unintentional UB in ui tests)
 - #108010 (Make `InferCtxt::can_eq` and `InferCtxt::can_sub` return booleans)
 - #108021 (make x look for x.py if shell script does not exist)
 - #108047 (Use `target` instead of `machine` for mir interpreter integer handling.)
 - #108049 (Don't suggest `#[doc(hidden)]` trait methods with matching return type)
 - #108066 (Better names for illegal impl trait positions)
 - #108076 (rustdoc: Use more let chain)
 - #108088 (clarify correctness of `black_box`)
 - #108094 (Demonstrate I/O in File examples)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/projection.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/projection.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/projection.rs b/compiler/rustc_const_eval/src/interpret/projection.rs
index 291464ab58a..91da930db4f 100644
--- a/compiler/rustc_const_eval/src/interpret/projection.rs
+++ b/compiler/rustc_const_eval/src/interpret/projection.rs
@@ -319,7 +319,7 @@ where
             // implement this.
             ty::Array(inner, _) => (MemPlaceMeta::None, self.tcx.mk_array(*inner, inner_len)),
             ty::Slice(..) => {
-                let len = Scalar::from_machine_usize(inner_len, self);
+                let len = Scalar::from_target_usize(inner_len, self);
                 (MemPlaceMeta::Meta(len), base.layout.ty)
             }
             _ => {
@@ -363,7 +363,7 @@ where
             Index(local) => {
                 let layout = self.layout_of(self.tcx.types.usize)?;
                 let n = self.local_to_op(self.frame(), local, Some(layout))?;
-                let n = self.read_machine_usize(&n)?;
+                let n = self.read_target_usize(&n)?;
                 self.place_index(base, n)?
             }
             ConstantIndex { offset, min_length, from_end } => {
@@ -392,7 +392,7 @@ where
             Index(local) => {
                 let layout = self.layout_of(self.tcx.types.usize)?;
                 let n = self.local_to_op(self.frame(), local, Some(layout))?;
-                let n = self.read_machine_usize(&n)?;
+                let n = self.read_target_usize(&n)?;
                 self.operand_index(base, n)?
             }
             ConstantIndex { offset, min_length, from_end } => {