27bb27f71c
This commit improves the diagnostic emitted when a tuple struct is being constructed which has private fields so that private fields are labelled and the message is improved. Signed-off-by: David Wood <david@davidtw.co>
30 lines
916 B
Plaintext
30 lines
916 B
Plaintext
error[E0532]: cannot match against a tuple struct which contains private fields
|
|
--> $DIR/issue-75907.rs:15:9
|
|
|
|
|
LL | let Bar(x, y, Foo(z)) = make_bar();
|
|
| ^^^
|
|
|
|
|
note: constructor is not visible here due to private fields
|
|
--> $DIR/issue-75907.rs:15:16
|
|
|
|
|
LL | let Bar(x, y, Foo(z)) = make_bar();
|
|
| ^ ^^^^^^ private field
|
|
| |
|
|
| private field
|
|
|
|
error[E0532]: cannot match against a tuple struct which contains private fields
|
|
--> $DIR/issue-75907.rs:15:19
|
|
|
|
|
LL | let Bar(x, y, Foo(z)) = make_bar();
|
|
| ^^^
|
|
|
|
|
note: constructor is not visible here due to private fields
|
|
--> $DIR/issue-75907.rs:15:23
|
|
|
|
|
LL | let Bar(x, y, Foo(z)) = make_bar();
|
|
| ^ private field
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0532`.
|