Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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