Confusing error relating to publicity of tuple struct fields (E0603) #46407
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I was struggling with a bit of code I wrote:
The error I got was:
Playground.
I was tearing my hair out about this -- why do I get this error? It is public?!. SuperCuber on the Rust discord helped me out by suggesting I make the field public, which solved my problem.
However, this error is misleading -- it suggests that the struct itself is private, not the field. There should perhaps be a clarifying note suggesting that the field(s) of the struct might need to be made public. It is worth noting that this error changes when you add a
use ::A::Foo
: playgroundMeta
Affects rust playground nightly, which I assume is using the latest version.
The text was updated successfully, but these errors were encountered: