Skip to content

properly handle anonymous regions appearing in return type - anon-anon conflicts  #44018

Closed
@gaurikholkar-zz

Description

@gaurikholkar-zz

For the following example, currently E0623 is disabled right now. This is how the error message will now look like.

fn foo<'a>(&self, x: &i32) -> &i32 {
    //               -----    ---- these references must have the same lifetime
    if true { &self.field } else { x }
    //                             ^ data from `x` is returned here
}

cc @nikomatsakis

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions