2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `z.x` as mutable
|
2017-02-06 15:41:28 -08:00
|
|
|
--> $DIR/issue-39544.rs:21:18
|
|
|
|
|
|
2017-03-11 11:11:50 -08:00
|
|
|
20 | let z = Z { x: X::Y };
|
2017-03-12 13:49:28 -07:00
|
|
|
| - consider changing this to `mut z`
|
2017-02-06 15:41:28 -08:00
|
|
|
21 | let _ = &mut z.x;
|
2017-03-12 21:28:49 -07:00
|
|
|
| ^^^ cannot mutably borrow immutable field
|
2017-02-06 15:41:28 -08:00
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `self.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:26:22
|
|
|
|
|
|
|
|
|
25 | fn foo<'z>(&'z self) {
|
|
|
|
| -------- use `&'z mut self` here to make mutable
|
|
|
|
26 | let _ = &mut self.x;
|
|
|
|
| ^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `self.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:30:22
|
|
|
|
|
|
|
|
|
29 | fn foo1(&self, other: &Z) {
|
|
|
|
| ----- use `&mut self` here to make mutable
|
|
|
|
30 | let _ = &mut self.x;
|
|
|
|
| ^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `other.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:31:22
|
|
|
|
|
|
|
|
|
29 | fn foo1(&self, other: &Z) {
|
|
|
|
| -- use `&mut Z` here to make mutable
|
|
|
|
30 | let _ = &mut self.x;
|
|
|
|
31 | let _ = &mut other.x;
|
|
|
|
| ^^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `self.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:35:22
|
|
|
|
|
|
|
|
|
34 | fn foo2<'a>(&'a self, other: &Z) {
|
|
|
|
| -------- use `&'a mut self` here to make mutable
|
|
|
|
35 | let _ = &mut self.x;
|
|
|
|
| ^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `other.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:36:22
|
|
|
|
|
|
|
|
|
34 | fn foo2<'a>(&'a self, other: &Z) {
|
|
|
|
| -- use `&mut Z` here to make mutable
|
|
|
|
35 | let _ = &mut self.x;
|
|
|
|
36 | let _ = &mut other.x;
|
|
|
|
| ^^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `self.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:40:22
|
|
|
|
|
|
|
|
|
39 | fn foo3<'a>(self: &'a Self, other: &Z) {
|
|
|
|
| -------- use `&'a mut Self` here to make mutable
|
|
|
|
40 | let _ = &mut self.x;
|
|
|
|
| ^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `other.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:41:22
|
|
|
|
|
|
|
|
|
39 | fn foo3<'a>(self: &'a Self, other: &Z) {
|
|
|
|
| -- use `&mut Z` here to make mutable
|
|
|
|
40 | let _ = &mut self.x;
|
|
|
|
41 | let _ = &mut other.x;
|
|
|
|
| ^^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `other.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:45:22
|
|
|
|
|
|
|
|
|
44 | fn foo4(other: &Z) {
|
|
|
|
| -- use `&mut Z` here to make mutable
|
|
|
|
45 | let _ = &mut other.x;
|
|
|
|
| ^^^^^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `z.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:51:18
|
2017-03-26 19:35:46 +03:00
|
|
|
|
|
2017-03-27 01:35:50 +03:00
|
|
|
50 | pub fn with_arg(z: Z, w: &Z) {
|
2017-03-26 19:35:46 +03:00
|
|
|
| - consider changing this to `mut z`
|
2017-03-27 01:35:50 +03:00
|
|
|
51 | let _ = &mut z.x;
|
2017-03-26 19:35:46 +03:00
|
|
|
| ^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0596]: cannot borrow immutable field `w.x` as mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
--> $DIR/issue-39544.rs:52:18
|
2017-03-26 19:35:46 +03:00
|
|
|
|
|
2017-03-27 01:35:50 +03:00
|
|
|
50 | pub fn with_arg(z: Z, w: &Z) {
|
2017-03-26 19:35:46 +03:00
|
|
|
| -- use `&mut Z` here to make mutable
|
2017-03-27 01:35:50 +03:00
|
|
|
51 | let _ = &mut z.x;
|
|
|
|
52 | let _ = &mut w.x;
|
2017-03-26 19:35:46 +03:00
|
|
|
| ^^^ cannot mutably borrow immutable field
|
|
|
|
|
2017-05-27 19:58:52 +02:00
|
|
|
error[E0594]: cannot assign to immutable borrowed content `*x.0`
|
2017-04-06 13:20:24 +03:00
|
|
|
--> $DIR/issue-39544.rs:58:5
|
|
|
|
|
|
|
|
|
58 | *x.0 = 1;
|
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
|
|
|
|
2017-05-22 18:46:05 +07:00
|
|
|
error: aborting due to previous error(s)
|
2017-02-06 15:41:28 -08:00
|
|
|
|