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