diff options
| author | Markus Reiter <me@reitermark.us> | 2024-02-22 14:59:52 +0100 |
|---|---|---|
| committer | Markus Reiter <me@reitermark.us> | 2024-02-25 12:03:48 +0100 |
| commit | b2fbb8a05392be976c67e3b0063203d5b049da5c (patch) | |
| tree | 798ac97adb74714b49df51d997c177ab056f9e34 /tests/codegen/slice-ref-equality.rs | |
| parent | 710048f790ebc9ebfac6039c6733570f8084c9de (diff) | |
| download | rust-b2fbb8a05392be976c67e3b0063203d5b049da5c.tar.gz rust-b2fbb8a05392be976c67e3b0063203d5b049da5c.zip | |
Use generic `NonZero` in tests.
Diffstat (limited to 'tests/codegen/slice-ref-equality.rs')
| -rw-r--r-- | tests/codegen/slice-ref-equality.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/codegen/slice-ref-equality.rs b/tests/codegen/slice-ref-equality.rs index 371e685ec6c..85d9c34a30b 100644 --- a/tests/codegen/slice-ref-equality.rs +++ b/tests/codegen/slice-ref-equality.rs @@ -1,8 +1,8 @@ //@ compile-flags: -O -Zmerge-functions=disabled - #![crate_type = "lib"] +#![feature(generic_nonzero)] -use std::num::{NonZeroI16, NonZeroU32}; +use std::num::NonZero; // #71602 reported a simple array comparison just generating a loop. // This was originally fixed by ensuring it generates a single bcmp, @@ -70,7 +70,7 @@ fn eq_slice_of_i32(x: &[i32], y: &[i32]) -> bool { // CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %1 // CHECK-SAME: [[USIZE]] noundef %3 #[no_mangle] -fn eq_slice_of_nonzero(x: &[NonZeroU32], y: &[NonZeroU32]) -> bool { +fn eq_slice_of_nonzero(x: &[NonZero<i32>], y: &[NonZero<i32>]) -> bool { // CHECK: icmp eq [[USIZE]] %1, %3 // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %1, 2 // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr @@ -82,7 +82,7 @@ fn eq_slice_of_nonzero(x: &[NonZeroU32], y: &[NonZeroU32]) -> bool { // CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %1 // CHECK-SAME: [[USIZE]] noundef %3 #[no_mangle] -fn eq_slice_of_option_of_nonzero(x: &[Option<NonZeroI16>], y: &[Option<NonZeroI16>]) -> bool { +fn eq_slice_of_option_of_nonzero(x: &[Option<NonZero<i16>>], y: &[Option<NonZero<i16>>]) -> bool { // CHECK: icmp eq [[USIZE]] %1, %3 // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %1, 1 // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr |
