Skip to content

Commit ac5ef58

Browse files
authored
Update expected outputs for default_in_statics and fn_ptr_global unsafe tests
1 parent 6df6b81 commit ac5ef58

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

tests/unit/out/unsafe/default_in_statics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub unsafe fn check_local_static_5() {
127127
static mut local_p_8: *mut i32 = unsafe { std::ptr::null_mut() };;
128128
assert!((local_outer_6.p1).is_null());
129129
assert!((local_outer_6.fn_).is_none());
130-
assert!((local_fn_7).is_none());
130+
assert!(unsafe { (&raw const local_fn_7).as_ref().unwrap().is_none() });
131131
assert!((local_p_8).is_null());
132132
}
133133
pub fn main() {
@@ -136,7 +136,7 @@ pub fn main() {
136136
}
137137
}
138138
unsafe fn main_0() -> i32 {
139-
assert!((static_fn_0).is_none());
139+
assert!(unsafe { (&raw const static_fn_0).as_ref().unwrap().is_none() });
140140
assert!((static_outer_1.p1).is_null());
141141
assert!((static_outer_1.p2).is_null());
142142
assert!((static_outer_1.cp).is_null());

tests/unit/out/unsafe/fn_ptr_global.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub unsafe fn set_op_3(mut fn_: Option<unsafe fn(i32) -> i32>) {
1717
g_op_2 = fn_;
1818
}
1919
pub unsafe fn call_op_4(mut x: i32) -> i32 {
20-
if !(unsafe { (&raw const g_op_2).as_ref().unwrap().is_none() }) {
20+
if !unsafe { (&raw const g_op_2).as_ref().unwrap().is_none() } {
2121
return (unsafe {
2222
let _arg0: i32 = x;
2323
(g_op_2).unwrap()(_arg0)
@@ -50,11 +50,6 @@ unsafe fn main_0() -> i32 {
5050
set_op_3(_fn)
5151
});
5252
assert!(unsafe { (&raw const g_op_2).as_ref().unwrap().is_none() });
53-
assert!(
54-
((unsafe {
55-
let _x: i32 = 5;
56-
call_op_4(_x)
57-
}) == (5))
58-
);
53+
assert!(((unsafe { call_op_4(5,) }) == (5)));
5954
return 0;
6055
}

0 commit comments

Comments
 (0)