diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-27 16:15:30 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-19 18:07:35 +0000 |
| commit | 5cf8107aa61e1b5c65ac5691523a9970e1fd884b (patch) | |
| tree | 77376cdf0794f4194f3c46a9d3cdb72f107e74ea /compiler/rustc_codegen_gcc | |
| parent | 9453d2cfebfbfb58753c8afef1df3686ae8c6197 (diff) | |
| download | rust-5cf8107aa61e1b5c65ac5691523a9970e1fd884b.tar.gz rust-5cf8107aa61e1b5c65ac5691523a9970e1fd884b.zip | |
Fix tests
Diffstat (limited to 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/intrinsic/simd.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs index 4e1b99fdebf..43dbfafa871 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs @@ -76,8 +76,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( ty::Uint(i) if i.bit_width() == Some(expected_int_bits) => args[0].immediate(), ty::Array(elem, len) if matches!(*elem.kind(), ty::Uint(ty::UintTy::U8)) - && len.try_eval_target_usize(bx.tcx, ty::ParamEnv::reveal_all()) - == Some(expected_bytes) => + && len + .try_to_target_usize(bx.tcx) + .expect("expected monomorphic const in codegen") + == expected_bytes => { let place = PlaceRef::alloca(bx, args[0].layout); args[0].val.store(bx, place); @@ -696,8 +698,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( } ty::Array(elem, len) if matches!(*elem.kind(), ty::Uint(ty::UintTy::U8)) - && len.try_eval_target_usize(bx.tcx, ty::ParamEnv::reveal_all()) - == Some(expected_bytes) => + && len + .try_to_target_usize(bx.tcx) + .expect("expected monomorphic const in codegen") + == expected_bytes => { // Zero-extend iN to the array length: let ze = bx.zext(result, bx.type_ix(expected_bytes * 8)); |
