Skip to content

lint against "silent elision" in structs/enums/etc #45992

Closed
@nikomatsakis

Description

@nikomatsakis

Now that support for '_ has landed, as part of #44524, it would be good to start linting for cases where it ought to be used. In particular, we wish to warn if there is a struct with lifetime parameters that are elided:

struct Foo<'a> { x: &'a u32 }
fn foo(x: &Foo) {
//         ^^^ warning: hidden lifetime parameters are deprecated, try `Foo<'_>`
}

This should be fairly straightforward to do during resolve_lifetimes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions