rustc_lint::builtin

Static UNNAMEABLE_TYPES

pub static UNNAMEABLE_TYPES: &'static Lint
Expand description

The unnameable_types lint detects types for which you can get objects of that type, but cannot name the type itself.

§Example

#![deny(unnameable_types)]
mod m {
    pub struct S;
}

pub fn get_unnameable() -> m::S { m::S }

{{produces}}

§Explanation

It is often expected that if you can obtain an object of type T, then you can name the type T as well, this lint attempts to enforce this rule. The recommended action is to either reexport the type properly to make it nameable, or document that users are not supposed to be able to name it for one reason or another.

Besides types, this lint applies to traits because traits can also leak through signatures, and you may obtain objects of their dyn Trait or impl Trait types.