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

12 lines
127 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;
x.x = 5;
}