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
I discovered yesterday that it's possible to leak private struct types in public functions if that struct is public but lives in a private module. Those on the Rust discord considered this a bug in Rust itself but since it's a breaking change, it might need to wait until 2024. So perhaps this should be added to clippy for the time being.
Categories (optional)
Kind: correctness?
Drawbacks
Perhaps this should instead just be added as a warning into rustc
The issue is that this pattern is supposedly intended and is a feature to implement sealed Traits, but it seems pretty much a bug to me for Structs.
Example
This is a minimal example showing the leaking of structs.
use foo::bbb;// use foo::bar::Bar; // error since `bar` is privatefnmain(){bbb();}mod foo {use bar::Bar;pubfnbbb() -> Bar{Bar}mod bar {pubstructBar;}}
The text was updated successfully, but these errors were encountered:
What it does
I discovered yesterday that it's possible to leak private struct types in public functions if that struct is public but lives in a private module. Those on the Rust discord considered this a bug in Rust itself but since it's a breaking change, it might need to wait until 2024. So perhaps this should be added to clippy for the time being.
Categories (optional)
Drawbacks
Perhaps this should instead just be added as a warning into rustc
The issue is that this pattern is supposedly intended and is a feature to implement sealed Traits, but it seems pretty much a bug to me for Structs.
Example
This is a minimal example showing the leaking of structs.
The text was updated successfully, but these errors were encountered: