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. #121346

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add clarifying comment to test.
  • Loading branch information
m-ou-se committed Feb 21, 2024
commit f4caa832dad4482ec1fa85bdbc3156c83cc948de
1 change: 1 addition & 0 deletions tests/ui/lifetimes/temporary-lifetime-extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 26,7 @@ fn main() {
}
};
let h = match temp() {
// The {} moves the value, making a new temporary.
owned_non_temporary => &{ owned_non_temporary },
};
println!("{a:?} {b:?} {c:?} {d:?} {e:?} {f:?} {g:?} {h:?}");
Expand Down
Loading