fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.2 KiB36 linesraw
1error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
2  --> $DIR/mut-arg-hint.rs:3:9
3   |
4LL |         a.push_str("bar");
5   |         ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
6   |
7help: consider changing this to be a mutable reference
8   |
9LL |     fn foo(mut a: &mut String) {
10   |                    +++
11
12error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
13  --> $DIR/mut-arg-hint.rs:8:5
14   |
15LL |     a.push_str("foo");
16   |     ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
17   |
18help: consider changing this to be a mutable reference
19   |
20LL | pub fn foo<'a>(mut a: &'a mut String) {
21   |                           +++
22
23error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
24  --> $DIR/mut-arg-hint.rs:15:9
25   |
26LL |         a.push_str("foo");
27   |         ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
28   |
29help: consider changing this to be a mutable reference
30   |
31LL |     pub fn foo(mut a: &mut String) {
32   |                        +++
33
34error: aborting due to 3 previous errors
35
36For more information about this error, try `rustc --explain E0596`.