ELIDED_LIFETIMES_IN_PATHS in rustc_lint::builtin - Rust
Description: The `elided_lifetimes_in_paths` lint detects the use of hidden lifetime parameters.

Skip to main content

## ELIDED_LIFETIMES_IN_PATHS

# Static ELIDED_LIFETIMES_IN_PATHS

Source

    pub static ELIDED_LIFETIMES_IN_PATHS: &'static Lint

Expand description

The `elided_lifetimes_in_paths` lint detects the use of hidden lifetime parameters.

#### §Example

ⓘ

    #![deny(elided_lifetimes_in_paths)]
    #![deny(warnings)]
    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.