rust/tests/ui/lint/unsafe_code/forge_unsafe_block.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
304 B
Rust
Raw Normal View History

2021-10-12 09:34:53 -05:00
// 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();
}
}