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

7 lines
122 B
Rust
Raw Normal View History

2012-05-10 21:58:23 -05:00
fn main() {
let x: int = 3;
let y: &mut int = &mut x; //~ ERROR illegal borrow
2012-05-10 21:58:23 -05:00
*y = 5;
log (debug, *y);
}