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