Skip to content

Lint for redundant lifetimes. #12805

Closed
Closed
@eddyb

Description

@eddyb

Sometimes refactorings can leave behind needlessly generic functions, like in this case:

fn foo<'a>(foo: &'a Foo<'a>) {...}

becomes

type Foo<'a> = &'a FooStruct<'a>;
fn foo<'a>(foo: Foo<'a>) {...}

If the lifetime 'a is not used anywhere else in foo, it isn't any different from an anonymous lifetime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions