Skip to content

Commit a40da5b

Browse files
Fix tests
1 parent 058e02c commit a40da5b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/intrinsic/simd.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
7676
ty::Uint(i) if i.bit_width() == Some(expected_int_bits) => args[0].immediate(),
7777
ty::Array(elem, len)
7878
if matches!(*elem.kind(), ty::Uint(ty::UintTy::U8))
79-
&& len.try_eval_target_usize(bx.tcx, ty::ParamEnv::reveal_all())
80-
== Some(expected_bytes) =>
79+
&& len
80+
.try_to_target_usize(bx.tcx)
81+
.expect("expected monomorphic const in codegen")
82+
== expected_bytes =>
8183
{
8284
let place = PlaceRef::alloca(bx, args[0].layout);
8385
args[0].val.store(bx, place);
@@ -696,8 +698,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
696698
}
697699
ty::Array(elem, len)
698700
if matches!(*elem.kind(), ty::Uint(ty::UintTy::U8))
699-
&& len.try_eval_target_usize(bx.tcx, ty::ParamEnv::reveal_all())
700-
== Some(expected_bytes) =>
701+
&& len
702+
.try_to_target_usize(bx.tcx)
703+
.expect("expected monomorphic const in codegen")
704+
== expected_bytes =>
701705
{
702706
// Zero-extend iN to the array length:
703707
let ze = bx.zext(result, bx.type_ix(expected_bytes * 8));

0 commit comments

Comments
 (0)