1
Fork 0
rust/src/test/ui/borrowck/reassignment_immutable_fields_overlapping.stderr

19 lines
611 B
Text
Raw Normal View History

error[E0381]: assign to part of possibly-uninitialized variable: `x`
2018-12-25 08:56:47 -07:00
--> $DIR/reassignment_immutable_fields_overlapping.rs:12:5
|
2019-03-09 15:03:44 +03:00
LL | x.a = 1;
| ^^^^^^^ use of possibly-uninitialized `x`
error[E0594]: cannot assign to `x.b`, as `x` is not declared as mutable
2018-12-25 08:56:47 -07:00
--> $DIR/reassignment_immutable_fields_overlapping.rs:13:5
|
LL | let x: Foo;
| - help: consider changing this to be mutable: `mut x`
2019-03-09 15:03:44 +03:00
LL | x.a = 1;
LL | x.b = 22;
| ^^^^^^^^ cannot assign
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0381`.