2023-05-27 13:00:51 +02:00
|
|
|
// edition: 2024
|
|
|
|
// compile-flags: -Zunstable-options
|
|
|
|
// check-pass
|
2023-10-26 15:39:25 +00:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Zthir-unsafeck
|
2023-05-27 13:00:51 +02:00
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![deny(unused_unsafe)]
|
|
|
|
|
|
|
|
unsafe fn unsf() {}
|
|
|
|
|
|
|
|
unsafe fn foo() {
|
|
|
|
unsf();
|
2023-10-26 15:39:25 +00:00
|
|
|
//[mir]~^ WARN call to unsafe function is unsafe and requires unsafe block
|
|
|
|
//[thir]~^^ WARN call to unsafe function `unsf` is unsafe and requires unsafe block
|
2023-05-27 13:00:51 +02:00
|
|
|
|
|
|
|
// no unused_unsafe
|
2023-10-26 15:39:25 +00:00
|
|
|
unsafe {
|
|
|
|
unsf();
|
|
|
|
}
|
2023-05-27 13:00:51 +02:00
|
|
|
}
|