rust/tests/ui/borrowck/borrowck-mut-addr-of-imm-var.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
128 B
Rust
Raw Normal View History

2012-05-10 21:58:23 -05:00
fn main() {
let x: isize = 3;
let y: &mut isize = &mut x; //~ ERROR cannot borrow
2012-05-10 21:58:23 -05:00
*y = 5;
2014-10-14 20:07:11 -05:00
println!("{}", *y);
2012-05-10 21:58:23 -05:00
}