17 lines
306 B
Rust
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();
|
|
}
|
|
}
|