2017-02-06 15:41:28 -08:00
|
|
|
error: cannot borrow immutable field `z.x` as mutable
|
|
|
|
--> $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-03-26 19:35:46 +03:00
|
|
|
error: cannot borrow immutable field `z.x` as mutable
|
|
|
|
--> $DIR/issue-39544.rs:25:18
|
|
|
|
|
|
|
|
|
24 | pub fn with_arg(z: Z, w: &Z) {
|
|
|
|
| - consider changing this to `mut z`
|
|
|
|
25 | let _ = &mut z.x;
|
|
|
|
| ^^^ cannot mutably borrow immutable field
|
|
|
|
|
|
|
|
error: cannot borrow immutable field `w.x` as mutable
|
|
|
|
--> $DIR/issue-39544.rs:26:18
|
|
|
|
|
|
|
|
|
24 | pub fn with_arg(z: Z, w: &Z) {
|
|
|
|
| -- use `&mut Z` here to make mutable
|
|
|
|
25 | let _ = &mut z.x;
|
|
|
|
26 | let _ = &mut w.x;
|
|
|
|
| ^^^ cannot mutably borrow immutable field
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2017-02-06 15:41:28 -08:00
|
|
|
|