Skip to content

Propagate temporary lifetime extension into if and match expressions #1548

Open
@xmh0511

Description

@xmh0511

Since 1.79, the temporaries are extended in the following example:

let a = if true {
    ..;
    &temp() // used to error, but now gets lifetime extended
} else {
    ..;
    &temp() // used to error, but now gets lifetime extended
};

The list in extending-based-on-expressions seems to be out-of-date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-destructorsArea: destructors, droppingNew ContentMissing features or aspects of language not currently documented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions