Closed
Description
mod a {
pub struct Error(usize);
}
fn main(){
let x = a::Error(3);
}
we emit
error[E0603]: tuple struct `Error` is private
--> src/main.rs:6:16
|
6 | let x = a::Error(3);
| ^^^^^
which is confusing and inconsistent with the same error in a regular struct:
error[E0451]: field `a` of struct `a::Error` is private
--> src/main.rs:6:23
|
6 | let x = a::Error {a: 3};
| ^^^^ field `a` is private
This has confused users in the past. CC #57951 and #52144, which are somewhat related.