Closed
Description
Code
#![allow(dead_code)]
mod a {
pub mod b {
pub(in crate::a) struct Huh;
pub fn eee() -> Huh { Huh }
}
}
Current output
warning: type `Huh` is more private than the item `eee`
--> src/lib.rs:6:9
|
6 | pub fn eee() -> Huh { Huh }
| ^^^^^^^^^^^^^^^^^^^ function `eee` is reachable at visibility `pub(crate)`
|
note: but type `Huh` is only usable at visibility `pub(a)`
--> src/lib.rs:5:9
|
5 | pub(in crate::a) struct Huh;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
Desired output
warning: type `Huh` is more private than the item `eee`
--> src/lib.rs:6:9
|
6 | pub fn eee() -> Huh { Huh }
| ^^^^^^^^^^^^^^^^^^^ function `eee` is reachable at visibility `pub(crate)`
|
note: but type `Huh` is only usable at visibility `pub(in crate::a)`
--> src/lib.rs:5:9
|
5 | pub(in crate::a) struct Huh;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
Rationale and extra context
pub(a)
is not valid rust code in any edition.
Other cases
No response
Rust Version
rustc 1.83.0-nightly (2bd1e89 2024-09-26)
binary: rustc
commit-hash: 2bd1e89
commit-date: 2024-09-26
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0
Anything else?
No response