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

13 lines
142 B
Rust
Raw Normal View History

// error-pattern:borrowed
struct S {
x: int
}
fn main() {
let x = @mut S { x: 3 };
let y: &S = x;
2013-04-30 16:35:01 -04:00
let z = x;
z.x = 5;
}