Suggest qualifying struct literal path to "escape the shadow" cast by struct-like enum variant #139601
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-lack-of-suggestion
Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
F-more_qualified_paths
`#![feature(more_qualified_paths)]`
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given
Self::S
(A) /E::S
(B) resolves to the enum variant, not the associated type and thusIdeally, since (and only since)
more_qualified_paths
is enabled, rustc would suggest qualifyingSelf::S
andE::S
via<Self as O>::S
and<E as O>::S
, respectively.These might be quite annoying to diagnose due to the sheer number of possible symptoms (e.g., missing fields, extra fields, fields of wrong type). Since this input is a bit contrived, marking P-low.
Case (A) is reminiscent of #57644 but still distinct (however, do we want to do anything here?).
The text was updated successfully, but these errors were encountered: