You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removing the pub use is clearly a breaking change, since downstream users would no longer be able to use First to refer to that enum variant.
The analogous case for functions, structs, enums, etc. is treated equivalently to the case where the function/struct/enum/etc. itself was deleted ("no longer accessible at its old path").
But the lint for enum variants specifically goes through the enum, so I believe that re-exports of enum variants right now wouldn't be caught by any lint. It's not currently obvious to me how to write a lint to catch this case.
In addition to the above scenario, the following variations should be considered for inclusion as test cases for this new lint:
the re-export is a glob re-export
the re-export renames the variant (pub use X as Y)
the enum is private but its variants are publicly re-exported (Is this even reasonable Rust? When might it be used?)
The text was updated successfully, but these errors were encountered:
Imagine a crate with the following code:
Removing the
pub use
is clearly a breaking change, since downstream users would no longer be able to useFirst
to refer to that enum variant.The analogous case for functions, structs, enums, etc. is treated equivalently to the case where the function/struct/enum/etc. itself was deleted ("no longer accessible at its old path").
But the lint for enum variants specifically goes through the enum, so I believe that re-exports of enum variants right now wouldn't be caught by any lint. It's not currently obvious to me how to write a lint to catch this case.
In addition to the above scenario, the following variations should be considered for inclusion as test cases for this new lint:
pub use X as Y
)The text was updated successfully, but these errors were encountered: