]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/immut-function-arguments.stderr
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / tests / ui / borrowck / immut-function-arguments.stderr
1 error[E0594]: cannot assign to `*y`, as `y` is not declared as mutable
2   --> $DIR/immut-function-arguments.rs:2:5
3    |
4 LL |     *y = 5;
5    |     ^^^^^^ cannot assign
6    |
7 help: consider changing this to be mutable
8    |
9 LL | fn f(mut y: Box<isize>) {
10    |      +++
11
12 error[E0594]: cannot assign to `*q`, as `q` is not declared as mutable
13   --> $DIR/immut-function-arguments.rs:6:35
14    |
15 LL |     let _frob = |q: Box<isize>| { *q = 2; };
16    |                                   ^^^^^^ cannot assign
17    |
18 help: consider changing this to be mutable
19    |
20 LL |     let _frob = |mut q: Box<isize>| { *q = 2; };
21    |                  +++
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0594`.