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
use core::nonzero::NonZero;use std::os::raw::c_void;typeFoo = NonZero<*constc_void>;// warning: private type in public interfacepubtypeBar = Foo;// warning: private type in public interfacepubtypeBaz = Foo;
I also tried pub useing NonZero and c_void but that didn't help, so it's not the types themselves that are the problem. It seems bizarre that Rust would complain about this behaviour when, for example, error messages are unaware of aliases. Even if they were, it would be trivial to resolve private aliases to the public types they are defined as, so I can't see the utility of disallowing this.
There's an issue about this (#30503) and a PR fixing this (#34193).
This could be implemented more than half a year ago, it's just decision making is sometimes super slow for secondary non-prioritized features.
I also tried
pub use
ingNonZero
andc_void
but that didn't help, so it's not the types themselves that are the problem. It seems bizarre that Rust would complain about this behaviour when, for example, error messages are unaware of aliases. Even if they were, it would be trivial to resolve private aliases to the public types they are defined as, so I can't see the utility of disallowing this.My
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: