-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Diagnostic regression (1.47 -> 1.48): public enum fields incorrectly described as "inaccessible fields". #79593
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Test example (try on playground):
Only
foo::Pub {}in the top levelcorrectshould say "cannot construct ... due to inaccessible fields", the other 3 errors should be "missing field ... in initializer", but it seems like it's treating theenumfield as private (even though it inheritspubfrom theenum).The "cannot construct ... due to inaccessible fields" error seems to be new in 1.48, as part of #76524, and unmodified since.
It's using
field.vis.is_accessible_from(...)which seems correct, but it's possibleenumfields are incapable of giving the right result, if they don't track theenum's own privacy (and they only know they inherit it, whatever it is).cc @davidtwco @estebank