Closed as not planned
Closed as not planned
Description
I tried this code:
#![allow(nonstandard_style)]
#![allow(clippy::missing_safety_doc, unused)]
type pid_t = i32;
pub unsafe fn getpid() -> pid_t {
pid_t::from(0)
}
pub fn getpid_SAFE_TRUTH() -> pid_t {
unsafe { getpid() }
}
without `-Zcrate-attr=feature(lazy_type_alias)´: no warnings
with -Zcrate-attr=feature(lazy_type_alias)
:
error[E0446]: private type alias `pid_t` in public interface
--> src/tools/clippy/tests/ui/auxiliary/extern_fake_libc.rs:5:1
|
4 | type pid_t = i32;
| ---------- `pid_t` declared as private
5 | pub unsafe fn getpid() -> pid_t {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type alias
error[E0446]: private type alias `pid_t` in public interface
--> src/tools/clippy/tests/ui/auxiliary/extern_fake_libc.rs:8:1
|
4 | type pid_t = i32;
| ---------- `pid_t` declared as private
...
8 | pub fn getpid_SAFE_TRUTH() -> pid_t {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type alias
error: aborting due to 2 previous errors
rustc 1.73.0-nightly (04abc370b 2023-07-28)
binary: rustc
commit-hash: 04abc370b9f3855b28172b65a7f7d5a433f41412
commit-date: 2023-07-28
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5