]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/issue-39544.stderr
Sync portable-simd to rust-lang/portable-simd@72df4c45056a8bc0d1b3f06fdc828722177f0763
[rust.git] / src / test / ui / did_you_mean / issue-39544.stderr
1 error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
2   --> $DIR/issue-39544.rs:11:13
3    |
4 LL |     let z = Z { x: X::Y };
5    |         - help: consider changing this to be mutable: `mut z`
6 LL |     let _ = &mut z.x;
7    |             ^^^^^^^^ cannot borrow as mutable
8
9 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
10   --> $DIR/issue-39544.rs:16:17
11    |
12 LL |     fn foo<'z>(&'z self) {
13    |                -------- help: consider changing this to be a mutable reference: `&'z mut self`
14 LL |         let _ = &mut self.x;
15    |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
16
17 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
18   --> $DIR/issue-39544.rs:20:17
19    |
20 LL |     fn foo1(&self, other: &Z) {
21    |             ----- help: consider changing this to be a mutable reference: `&mut self`
22 LL |         let _ = &mut self.x;
23    |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
24
25 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
26   --> $DIR/issue-39544.rs:21:17
27    |
28 LL |     fn foo1(&self, other: &Z) {
29    |                           -- help: consider changing this to be a mutable reference: `&mut Z`
30 LL |         let _ = &mut self.x;
31 LL |         let _ = &mut other.x;
32    |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
33
34 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
35   --> $DIR/issue-39544.rs:25:17
36    |
37 LL |     fn foo2<'a>(&'a self, other: &Z) {
38    |                 -------- help: consider changing this to be a mutable reference: `&'a mut self`
39 LL |         let _ = &mut self.x;
40    |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
41
42 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
43   --> $DIR/issue-39544.rs:26:17
44    |
45 LL |     fn foo2<'a>(&'a self, other: &Z) {
46    |                                  -- help: consider changing this to be a mutable reference: `&mut Z`
47 LL |         let _ = &mut self.x;
48 LL |         let _ = &mut other.x;
49    |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
50
51 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
52   --> $DIR/issue-39544.rs:30:17
53    |
54 LL |     fn foo3<'a>(self: &'a Self, other: &Z) {
55    |                       -------- help: consider changing this to be a mutable reference: `&'a mut Self`
56 LL |         let _ = &mut self.x;
57    |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
58
59 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
60   --> $DIR/issue-39544.rs:31:17
61    |
62 LL |     fn foo3<'a>(self: &'a Self, other: &Z) {
63    |                                        -- help: consider changing this to be a mutable reference: `&mut Z`
64 LL |         let _ = &mut self.x;
65 LL |         let _ = &mut other.x;
66    |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
67
68 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
69   --> $DIR/issue-39544.rs:35:17
70    |
71 LL |     fn foo4(other: &Z) {
72    |                    -- help: consider changing this to be a mutable reference: `&mut Z`
73 LL |         let _ = &mut other.x;
74    |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
75
76 error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
77   --> $DIR/issue-39544.rs:41:13
78    |
79 LL | pub fn with_arg(z: Z, w: &Z) {
80    |                 - help: consider changing this to be mutable: `mut z`
81 LL |     let _ = &mut z.x;
82    |             ^^^^^^^^ cannot borrow as mutable
83
84 error[E0596]: cannot borrow `w.x` as mutable, as it is behind a `&` reference
85   --> $DIR/issue-39544.rs:42:13
86    |
87 LL | pub fn with_arg(z: Z, w: &Z) {
88    |                          -- help: consider changing this to be a mutable reference: `&mut Z`
89 LL |     let _ = &mut z.x;
90 LL |     let _ = &mut w.x;
91    |             ^^^^^^^^ `w` is a `&` reference, so the data it refers to cannot be borrowed as mutable
92
93 error[E0594]: cannot assign to `*x.0`, which is behind a `&` reference
94   --> $DIR/issue-39544.rs:48:5
95    |
96 LL |     *x.0 = 1;
97    |     ^^^^^^^^ cannot assign
98
99 error: aborting due to 12 previous errors
100
101 Some errors have detailed explanations: E0594, E0596.
102 For more information about an error, try `rustc --explain E0594`.