Skip to content

improve case with one named, one anonymous lifetime parameter #42517

Closed
@nikomatsakis

Description

@nikomatsakis

@gaurikholkar is working on a patch to address the case of conflict between one named and one anonymous lifetime parameter. Driving example (with the rough error message that we want displayed inline):

fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
                       - consider changing the type of `y` to `&'a i32`
    if x > y { x } else { y }
                          ^ this reference must have lifetime 'a
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.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