Closed
Description
fn main() {
module::TupleStruct(0);
}
pub mod module {
pub struct TupleStruct(u8);
}
On stable/beta, the error message is very good:
error[E0450]: cannot invoke tuple struct constructor with private fields
--> <anon>:2:5
|
2 | module::TupleStruct(0);
| ^^^^^^^^^^^^^^^^^^^ cannot construct with a private field
...
6 | pub struct TupleStruct(u8);
| --- private field declared here
error: aborting due to previous error
On nightly, it's flat out lying to the user:
error: tuple struct `TupleStruct` is private
--> <anon>:2:5
|
2 | module::TupleStruct(0);
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error