summary refs log tree commit diff
path: root/src/test/ui/immut-function-arguments.rs
blob: 2cc9c694ef1985cd9631e3647466a1f34dfbf7e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// revisions: ast mir
//[mir]compile-flags: -Z borrowck=mir

fn f(y: Box<isize>) {
    *y = 5; //[ast]~ ERROR cannot assign
            //[mir]~^ ERROR cannot assign
}

fn g() {
    let _frob = |q: Box<isize>| { *q = 2; }; //[ast]~ ERROR cannot assign
    //[mir]~^ ERROR cannot assign
}

fn main() {}