rust/tests/ui/lint/unsafe_code/forge_unsafe_block.rs
2024-02-16 20:02:50 +00:00

17 lines
306 B
Rust

//@ check-pass
//@ aux-build:forge_unsafe_block.rs
#[macro_use]
extern crate forge_unsafe_block;
unsafe fn foo() {}
#[forbid(unsafe_code)]
fn main() {
// `forbid` doesn't work for non-user-provided unsafe blocks.
// see `UnsafeCode::check_expr`.
forge_unsafe_block! {
foo();
}
}