2 // [thir]compile-flags: -Z thir-unsafeck
4 // Ensure we get unsafe function after coercion
5 unsafe fn add(a: i32, b: i32) -> i32 {
9 // We can coerce non-capturing closure to unsafe function
12 "-" => |a, b| (a - b) as i32,
13 _ => unimplemented!(),
15 let result: i32 = foo(5, 5); //~ ERROR call to unsafe function
18 // We can coerce unsafe function to non-capturing closure
20 "-" => |a, b| (a - b) as i32,
22 _ => unimplemented!(),
24 let result: i32 = foo(5, 5); //~ ERROR call to unsafe function