summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-mut-addr-of-imm-var.rs
blob: a79a239cbe004a48a3e9b54ccfd15b7805d32f53 (plain)
1
2
3
4
5
6
fn main() {
    let x: isize = 3;
    let y: &mut isize = &mut x; //~ ERROR cannot borrow
    *y = 5;
    println!("{}", *y);
}