]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/mut-arg-hint.stderr
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / span / mut-arg-hint.stderr
1 error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
2   --> $DIR/mut-arg-hint.rs:3:9
3    |
4 LL |         a.push_str("bar");
5    |         ^^^^^^^^^^^^^^^^^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
6    |
7 help: consider changing this to be a mutable reference
8    |
9 LL |     fn foo(mut a: &mut String) {
10    |                   ~~~~~~~~~~~
11
12 error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
13   --> $DIR/mut-arg-hint.rs:8:5
14    |
15 LL |     a.push_str("foo");
16    |     ^^^^^^^^^^^^^^^^^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
17    |
18 help: consider changing this to be a mutable reference
19    |
20 LL | pub fn foo<'a>(mut a: &'a mut String) {
21    |                       ~~~~~~~~~~~~~~
22
23 error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
24   --> $DIR/mut-arg-hint.rs:15:9
25    |
26 LL |         a.push_str("foo");
27    |         ^^^^^^^^^^^^^^^^^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
28    |
29 help: consider changing this to be a mutable reference
30    |
31 LL |     pub fn foo(mut a: &mut String) {
32    |                       ~~~~~~~~~~~
33
34 error: aborting due to 3 previous errors
35
36 For more information about this error, try `rustc --explain E0596`.