Expand description

The elided_lifetimes_in_associated_constant lint detects elided lifetimes that were erroneously allowed in associated constants.



struct Foo;

impl Foo {
    const STR: &str = "hello, world";



Previous version of Rust

Implicit static-in-const behavior was decided against for associated constants because of ambiguity. This, however, regressed and the compiler erroneously treats elided lifetimes in associated constants as lifetime parameters on the impl.

This is a future-incompatible lint to transition this to a hard error in the future.