about summary refs log tree commit diff
path: root/src/test/ui/mut-function-arguments.rs
blob: 620d00edbbce3609e767c103098ad62e2d5b8439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// run-pass

#![feature(box_syntax)]

fn f(mut y: Box<isize>) {
    *y = 5;
    assert_eq!(*y, 5);
}

fn g() {
    let frob = |mut q: Box<isize>| { *q = 2; assert_eq!(*q, 2); };
    let w = box 37;
    frob(w);

}

pub fn main() {
    let z = box 17;
    f(z);
    g();
}