about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-10-24 08:51:44 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-10-24 08:51:44 +0000
commit0093a4b92074239a4e8a29338286b7dabad3427b (patch)
tree6fd3c7d5cc42a8a31950c87cfe92966c75e4acfd
parent45c2002f08d7d2dfa0c4e197523c82575bdcd6e3 (diff)
parent65201c20a6c7dddc4581b59c2cab46de86c299eb (diff)
downloadrust-0093a4b92074239a4e8a29338286b7dabad3427b.tar.gz
rust-0093a4b92074239a4e8a29338286b7dabad3427b.zip
Sync from rust 4f2f477fded0a47b21ed3f6aeddeafa5db8bf518
-rw-r--r--src/intrinsics/simd.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/intrinsics/simd.rs b/src/intrinsics/simd.rs
index cbe411d78d5..e7f9f894381 100644
--- a/src/intrinsics/simd.rs
+++ b/src/intrinsics/simd.rs
@@ -133,6 +133,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
                 .expect_const()
                 .try_to_valtree()
                 .expect("expected monomorphic const in codegen")
+                .0
                 .unwrap_branch();
 
             assert_eq!(x.layout(), y.layout());
@@ -806,8 +807,10 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
                 ty::Uint(i) if i.bit_width() == Some(expected_int_bits) => m.load_scalar(fx),
                 ty::Array(elem, len)
                     if matches!(elem.kind(), ty::Uint(ty::UintTy::U8))
-                        && len.try_eval_target_usize(fx.tcx, ty::ParamEnv::reveal_all())
-                            == Some(expected_bytes) =>
+                        && len
+                            .try_to_target_usize(fx.tcx)
+                            .expect("expected monomorphic const in codegen")
+                            == expected_bytes =>
                 {
                     m.force_stack(fx).0.load(
                         fx,
@@ -907,8 +910,10 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
                 ty::Uint(i) if i.bit_width() == Some(expected_int_bits) => {}
                 ty::Array(elem, len)
                     if matches!(elem.kind(), ty::Uint(ty::UintTy::U8))
-                        && len.try_eval_target_usize(fx.tcx, ty::ParamEnv::reveal_all())
-                            == Some(expected_bytes) => {}
+                        && len
+                            .try_to_target_usize(fx.tcx)
+                            .expect("expected monomorphic const in codegen")
+                            == expected_bytes => {}
                 _ => {
                     fx.tcx.dcx().span_fatal(
                         span,