rust/tests/ui/unsafe/unsafe-fn-used-as-value.rs

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

12 lines
244 B
Rust
Raw Normal View History

// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
2012-08-02 00:30:05 +00:00
unsafe fn f() { return; }
fn main() {
let x = f;
x();
//[mir]~^ ERROR call to unsafe function is unsafe
//[thir]~^^ ERROR call to unsafe function `f` is unsafe
}