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

12 lines
204 B
Rust
Raw Normal View History

// error-pattern:borrowed
// Test that write guards trigger when there is a write to a directly
// frozen @mut box.
fn main() {
let x = @mut 3;
let y: &mut int = x;
2013-04-30 15:35:01 -05:00
let z = x;
*z = 5;
}