1
Fork 0

Use generic NonZero in tests.

This commit is contained in:
Markus Reiter 2024-02-22 14:59:52 +01:00
parent 710048f790
commit b2fbb8a053
No known key found for this signature in database
GPG key ID: 245293B51702655B
43 changed files with 519 additions and 516 deletions

View file

@ -1,10 +1,10 @@
//@ compile-flags: -O -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(dyn_star)]
#![feature(generic_nonzero)]
use std::mem::MaybeUninit;
use std::num::NonZeroU64;
use std::num::NonZero;
use std::marker::PhantomPinned;
use std::ptr::NonNull;
@ -70,13 +70,13 @@ pub fn int(x: u64) -> u64 {
// CHECK: noundef i64 @nonzero_int(i64 noundef %x)
#[no_mangle]
pub fn nonzero_int(x: NonZeroU64) -> NonZeroU64 {
pub fn nonzero_int(x: NonZero<u64>) -> NonZero<u64> {
x
}
// CHECK: noundef i64 @option_nonzero_int(i64 noundef %x)
#[no_mangle]
pub fn option_nonzero_int(x: Option<NonZeroU64>) -> Option<NonZeroU64> {
pub fn option_nonzero_int(x: Option<NonZero<u64>>) -> Option<NonZero<u64>> {
x
}