fork/rust

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

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

master
1.5 KiB47 linesraw
1error[E0594]: cannot assign to `self.0`, which is behind a `&` reference
2  --> $DIR/suggest-ref-mut.rs:7:9
3   |
4LL |         self.0 = 32;
5   |         ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written
6   |
7help: consider changing this to be a mutable reference
8   |
9LL |     fn zap(&mut self) {
10   |            ~~~~~~~~~
11
12error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
13  --> $DIR/suggest-ref-mut.rs:15:5
14   |
15LL |     *foo = 32;
16   |     ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
17   |
18help: consider changing this to be a mutable reference
19   |
20LL |     let ref mut foo = 16;
21   |             +++
22
23error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
24  --> $DIR/suggest-ref-mut.rs:19:9
25   |
26LL |         *bar = 32;
27   |         ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
28   |
29help: consider changing this to be a mutable reference
30   |
31LL |     if let Some(ref mut bar) = Some(16) {
32   |                     +++
33
34error[E0594]: cannot assign to `*quo`, which is behind a `&` reference
35  --> $DIR/suggest-ref-mut.rs:23:22
36   |
37LL |         ref quo => { *quo = 32; },
38   |                      ^^^^^^^^^ `quo` is a `&` reference, so the data it refers to cannot be written
39   |
40help: consider changing this to be a mutable reference
41   |
42LL |         ref mut quo => { *quo = 32; },
43   |             +++
44
45error: aborting due to 4 previous errors
46
47For more information about this error, try `rustc --explain E0594`.