rust/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs

7 lines
122 B
Rust

fn main() {
let x: int = 3;
let y: &mut int = &mut x; //~ ERROR illegal borrow
*y = 5;
log (debug, *y);
}