use core::nonzero::NonZero;
use std::os::raw::c_void;
type Foo = NonZero<*const c_void>;
// warning: private type in public interface
pub type Bar = Foo;
// warning: private type in public interface
pub type Baz = Foo;
I also tried pub use
ing 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.
My rustc --version --verbose
:
rustc 1.11.0-nightly (6b4511755 2016-06-14)
binary: rustc
commit-hash: 6b4511755cfe63a46f2db8c72145e07f94911c08
commit-date: 2016-06-14
host: x86_64-unknown-linux-gnu
release: 1.11.0-nightly
There's an issue about this (https://github.com/rust-lang/rust/issues/30503) and a PR fixing this (https://github.com/rust-lang/rust/pull/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.
Most helpful comment
There's an issue about this (https://github.com/rust-lang/rust/issues/30503) and a PR fixing this (https://github.com/rust-lang/rust/pull/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.