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