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