-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.