]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/mut-arg-hint.stderr
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / 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 |     fn foo(mut a: &String) {
5    |                   ------- help: consider changing this to be a mutable reference: `&mut String`
6 LL |         a.push_str("bar");
7    |         ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
8
9 error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
10   --> $DIR/mut-arg-hint.rs:8:5
11    |
12 LL | pub fn foo<'a>(mut a: &'a String) {
13    |                       ---------- help: consider changing this to be a mutable reference: `&'a mut String`
14 LL |     a.push_str("foo");
15    |     ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
16
17 error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
18   --> $DIR/mut-arg-hint.rs:15:9
19    |
20 LL |     pub fn foo(mut a: &String) {
21    |                       ------- help: consider changing this to be a mutable reference: `&mut String`
22 LL |         a.push_str("foo");
23    |         ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
24
25 error: aborting due to 3 previous errors
26
27 For more information about this error, try `rustc --explain E0596`.