2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
|
|
|
|
--> $DIR/issue-39544.rs:11:13
|
2017-02-06 17:41:28 -06:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut z.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
2023-01-01 02:06:31 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be mutable
|
|
|
|
|
|
|
|
|
LL | let mut z = Z { x: X::Y };
|
|
|
|
| +++
|
2017-02-06 17:41:28 -06:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:16:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut self.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo<'z>(&'z mut self) {
|
|
|
|
| ~~~~~~~~~~~~
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:20:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut self.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo1(&mut self, other: &Z) {
|
|
|
|
| ~~~~~~~~~
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:21:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut other.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo1(&self, other: &mut Z) {
|
2023-04-19 02:50:08 -05:00
|
|
|
| +++
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:25:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut self.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo2<'a>(&'a mut self, other: &Z) {
|
|
|
|
| ~~~~~~~~~~~~
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:26:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut other.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo2<'a>(&'a self, other: &mut Z) {
|
2023-04-19 02:50:08 -05:00
|
|
|
| +++
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:30:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut self.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo3<'a>(self: &'a mut Self, other: &Z) {
|
2023-04-19 02:29:28 -05:00
|
|
|
| +++
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:31:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut other.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo3<'a>(self: &'a Self, other: &mut Z) {
|
2023-04-19 02:50:08 -05:00
|
|
|
| +++
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:35:17
|
2017-03-26 17:35:50 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut other.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | fn foo4(other: &mut Z) {
|
2023-04-19 02:50:08 -05:00
|
|
|
| +++
|
2017-03-26 17:35:50 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
|
|
|
|
--> $DIR/issue-39544.rs:41:13
|
2017-03-26 11:35:46 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut z.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
2023-01-01 02:06:31 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be mutable
|
|
|
|
|
|
|
|
|
LL | pub fn with_arg(mut z: Z, w: &Z) {
|
|
|
|
| +++
|
2017-03-26 11:35:46 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `w.x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/issue-39544.rs:42:13
|
2017-03-26 11:35:46 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _ = &mut w.x;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^ `w` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | pub fn with_arg(z: Z, w: &mut Z) {
|
2023-04-19 02:50:08 -05:00
|
|
|
| +++
|
2017-03-26 11:35:46 -05:00
|
|
|
|
2021-07-02 11:29:49 -05:00
|
|
|
error[E0594]: cannot assign to `*x.0`, which is behind a `&` reference
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-39544.rs:48:5
|
2017-04-06 05:20:24 -05:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | *x.0 = 1;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^ cannot assign
|
2017-04-06 05:20:24 -05:00
|
|
|
|
2017-07-02 05:49:30 -05:00
|
|
|
error: aborting due to 12 previous errors
|
2017-02-06 17:41:28 -06:00
|
|
|
|
2019-11-06 06:58:44 -06:00
|
|
|
Some errors have detailed explanations: E0594, E0596.
|
|
|
|
For more information about an error, try `rustc --explain E0594`.
|