Static rustc_lint_defs::builtin::UNINHABITED_STATIC

source ·
pub static UNINHABITED_STATIC: &Lint
Expand description

The uninhabited_static lint detects uninhabited statics.


enum Void {}
extern {
    static EXTERN: Void;



Statics with an uninhabited type can never be initialized, so they are impossible to define. However, this can be side-stepped with an extern static, leading to problems later in the compiler which assumes that there are no initialized uninhabited places (such as locals or statics). This was accidentally allowed, but is being phased out.