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-11 02:58:23 +00:00
fn main() {
let x: isize = 3;
let y: &mut isize = &mut x; //~ ERROR cannot borrow
2012-05-11 02:58:23 +00:00
*y = 5;
2014-10-15 01:07:11 +00:00
println!("{}", *y);
2012-05-11 02:58:23 +00:00
}