rust/src/test/run-fail/borrowck-wg-fail.rs

14 lines
142 B
Rust

// error-pattern:borrowed
fn f(x: &int, y: @mut int) {
unsafe {
*y = 2;
}
}
fn main() {
let x = @mut 3;
f(x, x);
}