Closed
Description
Given the following code:
#[warn(unreachable_pub)]
mod inner {
#[allow(unused)]
pub enum T {
A(u32),
}
}
The current output is:
warning: unreachable `pub` item
--> src/main.rs:4:5
|
4 | pub enum T {
| ---^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
note: the lint level is defined here
--> src/main.rs:1:8
|
1 | #[warn(unreachable_pub)]
| ^^^^^^^^^^^^^^^
= help: or consider exporting it for use by other crates
warning: unreachable `pub` field
--> src/main.rs:5:11
|
5 | A(u32),
| -^^
| |
| help: consider restricting its visibility: `pub(crate)`
Which basically brokes cargo-fix, i.e cargo fix --broken-code
produces invalid code:
#[warn(unreachable_pub)]
mod inner {
#[allow(unused)]
pub(crate) enum T {
A(pub(crate)u32),
}
}
That seems to affect any enum with variant fields.