[][src]Static rustc_ap_rustc_session::lint::builtin::ELIDED_LIFETIMES_IN_PATHS

pub static  ELIDED_LIFETIMES_IN_PATHS: &Lint

The elided_lifetimes_in_paths lint detects the use of hidden lifetime parameters.

Example

This example deliberately fails to compile
#![deny(elided_lifetimes_in_paths)]
struct Foo<'a> {
    x: &'a u32
}

fn foo(x: &Foo) {
}

{{produces}}

Explanation

Elided lifetime parameters can make it difficult to see at a glance that borrowing is occurring. This lint ensures that lifetime parameters are always explicitly stated, even if it is the '_ placeholder lifetime.

This lint is "allow" by default because it has some known issues, and may require a significant transition for old code.