Static rustc_lint_defs::builtin::PRIVATE_INTERFACES
source · pub static PRIVATE_INTERFACES: &Lint
Expand description
The private_interfaces
lint detects types in a primary interface of an item,
that are more private than the item itself. Primary interface of an item is all
its interface except for bounds on generic parameters and where clauses.
Example
ⓘ
#![deny(private_interfaces)]
struct SemiPriv;
mod m1 {
struct Priv;
impl crate::SemiPriv {
pub fn f(_: Priv) {}
}
}
{{produces}}
Explanation
Having something private in primary interface guarantees that the item will be unusable from outer modules due to type privacy.