]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mut-function-arguments.rs
Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyup
[rust.git] / src / test / ui / mut-function-arguments.rs
1 // run-pass
2
3 #![feature(box_syntax)]
4
5 fn f(mut y: Box<isize>) {
6     *y = 5;
7     assert_eq!(*y, 5);
8 }
9
10 fn g() {
11     let frob = |mut q: Box<isize>| { *q = 2; assert_eq!(*q, 2); };
12     let w = box 37;
13     frob(w);
14
15 }
16
17 pub fn main() {
18     let z = box 17;
19     f(z);
20     g();
21 }