dead_code
lint does not trigger on pub
fields of restricted types
#85255
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-visibility
Area: Visibility / privacy
C-bug
Category: This is a bug.
I tried this code:
I expected to see this happen: All of
{Foo, Bar}::{a, b}
are caught by thedead_code
lint. Even though{Foo, Bar}::b
are declaredpub
, they should both inherit the visibility of their parent items since there is no way for external code to access them.Instead, this happened: No warning is emitted for
Foo::b
:Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: