extern crate issue_75907 as a;
-use a::{make_bar, Bar};
+use a::{make_bar, Bar, Foo};
fn main() {
let Bar(x, y, z) = make_bar();
//~^ ERROR cannot match against a tuple struct which contains private fields
+
+ let Foo(x, y, z) = Foo::new();
+ //~^ ERROR cannot match against a tuple struct which contains private fields
}
--> $DIR/issue-75907_b.rs:9:9
|
LL | let Bar(x, y, z) = make_bar();
- | ^^^ constructor is not visible here due to private fields
+ | ^^^
+ |
+note: constructor is not visible here due to private fields
+ --> $DIR/issue-75907_b.rs:9:16
+ |
+LL | let Bar(x, y, z) = make_bar();
+ | ^ ^ private field
+ | |
+ | private field
+
+error[E0532]: cannot match against a tuple struct which contains private fields
+ --> $DIR/issue-75907_b.rs:12:9
+ |
+LL | let Foo(x, y, z) = Foo::new();
+ | ^^^
+ |
+note: constructor is not visible here due to private fields
+ --> $DIR/issue-75907_b.rs:12:13
+ |
+LL | let Foo(x, y, z) = Foo::new();
+ | ^ ^ private field
+ | |
+ | private field
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0532`.
--> $DIR/struct.rs:20:14
|
LL | let ts = TupleStruct(640, 480);
- | ^^^^^^^^^^^ constructor is not visible here due to private fields
+ | ^^^^^^^^^^^
error[E0423]: expected value, found struct `UnitStruct`
--> $DIR/struct.rs:29:14