rust/src/test/compile-fail/unsafe-fn-used-in-bind.rs

10 lines
180 B
Rust
Raw Normal View History

// -*- rust -*-
// error-pattern: unsafe functions can only be called
unsafe fn f(x: int, y: int) -> int { ret x + y; }
fn main() {
let x = bind f(3, _);
let y = x(4);
}