2017-10-06 16:30:23 -04:00
|
|
|
error[E0594]: cannot assign to immutable borrowed content `*x`
|
|
|
|
--> $DIR/enum.rs:21:5
|
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | let Wrap(x) = &Wrap(3);
|
2017-10-06 16:30:23 -04:00
|
|
|
| - consider changing this to `x`
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | *x += 1; //~ ERROR cannot assign to immutable
|
2017-10-06 16:30:23 -04:00
|
|
|
| ^^^^^^^ cannot borrow as mutable
|
|
|
|
|
|
|
|
error[E0594]: cannot assign to immutable borrowed content `*x`
|
|
|
|
--> $DIR/enum.rs:25:9
|
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | if let Some(x) = &Some(3) {
|
2017-10-06 16:30:23 -04:00
|
|
|
| - consider changing this to `x`
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | *x += 1; //~ ERROR cannot assign to immutable
|
2017-10-06 16:30:23 -04:00
|
|
|
| ^^^^^^^ cannot borrow as mutable
|
|
|
|
|
|
|
|
error[E0594]: cannot assign to immutable borrowed content `*x`
|
|
|
|
--> $DIR/enum.rs:31:9
|
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | while let Some(x) = &Some(3) {
|
2017-10-06 16:30:23 -04:00
|
|
|
| - consider changing this to `x`
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | *x += 1; //~ ERROR cannot assign to immutable
|
2017-10-06 16:30:23 -04:00
|
|
|
| ^^^^^^^ cannot borrow as mutable
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
2018-02-19 21:40:25 +01:00
|
|
|
If you want more information on this error, try using "rustc --explain E0594"
|