rust/src/test/compile-fail/unsafe-fn-used-as-value.rs

10 lines
133 B
Rust
Raw Normal View History

// -*- rust -*-
// error-pattern: unsafe functions can only be called
unsafe fn f() { ret; }
fn main() {
let x = f;
x();
}