2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `z.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:11:18
|
2017-02-06 15:41:28 -08:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let z = Z { x: X::Y };
|
2018-09-12 14:13:40 -04:00
|
|
|
| - help: make this binding mutable: `mut z`
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut z.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^ cannot mutably borrow field of immutable binding
|
2017-02-06 15:41:28 -08:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:16:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo<'z>(&'z self) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| -------- use `&'z mut self` here to make mutable
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:20:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo1(&self, other: &Z) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| ----- use `&mut self` here to make mutable
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:21:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo1(&self, other: &Z) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| -- use `&mut Z` here to make mutable
|
2018-02-25 02:01:39 +03:00
|
|
|
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut other.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:25:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo2<'a>(&'a self, other: &Z) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| -------- use `&'a mut self` here to make mutable
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:26:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo2<'a>(&'a self, other: &Z) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| -- use `&mut Z` here to make mutable
|
2018-02-25 02:01:39 +03:00
|
|
|
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut other.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:30:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo3<'a>(self: &'a Self, other: &Z) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| -------- use `&'a mut Self` here to make mutable
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:31:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo3<'a>(self: &'a Self, other: &Z) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| -- use `&mut Z` here to make mutable
|
2018-02-25 02:01:39 +03:00
|
|
|
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut other.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:35:22
|
2017-03-27 01:35:50 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo4(other: &Z) {
|
2017-03-27 01:35:50 +03:00
|
|
|
| -- use `&mut Z` here to make mutable
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut other.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^^^^^ cannot mutably borrow field of immutable binding
|
2017-03-27 01:35:50 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `z.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:41:18
|
2017-03-26 19:35:46 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | pub fn with_arg(z: Z, w: &Z) {
|
2018-09-12 14:13:40 -04:00
|
|
|
| - help: make this binding mutable: `mut z`
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut z.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^ cannot mutably borrow field of immutable binding
|
2017-03-26 19:35:46 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0596]: cannot borrow field `w.x` of immutable binding as mutable
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:42:18
|
2017-03-26 19:35:46 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | pub fn with_arg(z: Z, w: &Z) {
|
2017-03-26 19:35:46 +03:00
|
|
|
| -- use `&mut Z` here to make mutable
|
2018-02-25 02:01:39 +03:00
|
|
|
LL | let _ = &mut z.x; //~ ERROR cannot borrow
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let _ = &mut w.x; //~ ERROR cannot borrow
|
2017-12-31 15:32:41 -08:00
|
|
|
| ^^^ cannot mutably borrow field of immutable binding
|
2017-03-26 19:35:46 +03:00
|
|
|
|
2017-12-31 15:32:41 -08:00
|
|
|
error[E0594]: cannot assign to borrowed content `*x.0` of immutable binding
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-39544.rs:48:5
|
2017-04-06 13:20:24 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | *x.0 = 1;
|
2017-04-06 13:20:24 +03:00
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
|
|
|
|
2017-07-02 13:49:30 +03:00
|
|
|
error: aborting due to 12 previous errors
|
2017-02-06 15:41:28 -08:00
|
|
|
|
2018-03-03 15:59:40 +01:00
|
|
|
Some errors occurred: E0594, E0596.
|
|
|
|
For more information about an error, try `rustc --explain E0594`.
|