Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate temporary lifetime extension into if and match expressions #1548

Open
xmh0511 opened this issue Jul 26, 2024 · 1 comment
Open
Labels
A-destructors Area: destructors, dropping New Content Missing features or aspects of language not currently documented.

Comments

@xmh0511
Copy link

xmh0511 commented Jul 26, 2024

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.

@ehuss
Copy link
Contributor

ehuss commented Jul 26, 2024

cc rust-lang/rust#121346. @m-ou-se would you be able to help with that?

@ehuss ehuss added A-destructors Area: destructors, dropping New Content Missing features or aspects of language not currently documented. labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-destructors Area: destructors, dropping New Content Missing features or aspects of language not currently documented.
Projects
None yet
Development

No branches or pull requests

2 participants