about summary refs log tree commit diff
path: root/src/test/compile-fail/borrowck-wg-borrow-mut-to-imm-fail.rs
blob: 36d32fddda1503bf2c827c94eb675af7cdf2c4d3 (plain)
1
2
3
4
5
6
7
fn main() {
    let mut b = ~3;
    let _x = &mut *b;   //~ NOTE loan of mutable local variable granted here
    let mut y = /*move*/ b; //~ ERROR moving out of mutable local variable prohibited
    *y += 1;
}