Skip to content

Commit ced947f

Browse files
test that MaybeUninit<bool> is not noundef
1 parent 8cb0b6c commit ced947f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/codegen/function-arguments.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#![crate_type = "lib"]
44
#![feature(rustc_attrs)]
55

6+
use std::mem::MaybeUninit;
7+
68
pub struct S {
79
_field: [i32; 8],
810
}
@@ -17,6 +19,12 @@ pub fn boolean(x: bool) -> bool {
1719
x
1820
}
1921

22+
// CHECK: i8 @maybeuninit_boolean(i8 %x)
23+
#[no_mangle]
24+
pub fn maybeuninit_boolean(x: MaybeUninit<bool>) -> MaybeUninit<bool> {
25+
x
26+
}
27+
2028
// CHECK: @readonly_borrow(i32* noalias readonly align 4 dereferenceable(4) %_1)
2129
// FIXME #25759 This should also have `nocapture`
2230
#[no_mangle]

0 commit comments

Comments
 (0)