rust/src/test/compile-fail/unsafe-alias.rs

8 lines
189 B
Rust
Raw Normal View History

// error-pattern:may alias with argument
fn foo(x: &int, f: fn()) { log x; }
2011-07-27 14:19:39 +02:00
fn whoknows(x: @mutable int) { *x = 10; }
fn main() { let box = @mutable 1; foo(*box, bind whoknows(box)); }