Repository navigation
Tracking Issue for Rust 2024: Rescope temporary lifetimes with respect to else #124085
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-edition-2024Area: The 2024 editionArea: The 2024 editionC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCL-if_let_rescopeLint: if_let_rescopeLint: if_let_rescopeS-tracking-ready-for-editionStatus: This issue is ready for inclusion in the edition.Status: This issue is ready for inclusion in the edition.T-langRelevant to the language teamRelevant to the language team
Description
This is a tracking issue for shortening the scope of temporary lifetimes in if-let blocks to end before else. E.g.:
if let Some(x) = ref_cell.write().some_method_that_returns_option() {
} else {
// question is whether the `ref_cell` is still write-locked here;
// currently, it is, but it wouldn't be under this change
}About tracking issues
Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement with a feature gate.
- Do a crater run to analyze impact.
- Decide to stabilize in Rust 2024.
- Stabilize in nightly Rust 2024.
- Implement migration lints.
- N/A: Add documentation to the dev guide.
- See the instructions.
- Add documentation to the reference.
- Add documentation to the edition guide.
- Ensure ready for Rust 2024 stabilization.
Unresolved Questions
TODO.
Related
- Drop order twist of && and || chains #103107
- if let should pre-drop wrt else #103108
- Let chain temporaries should drop before else #103248
- Remove drop order twist of && and || and make them associative #103293
- Broken MIR ICE with let chains #104843
- Rescope temp lifetime in if-let into IfElse with migration lint #107251
Implementation history
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-edition-2024Area: The 2024 editionArea: The 2024 editionC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCL-if_let_rescopeLint: if_let_rescopeLint: if_let_rescopeS-tracking-ready-for-editionStatus: This issue is ready for inclusion in the edition.Status: This issue is ready for inclusion in the edition.T-langRelevant to the language teamRelevant to the language team
Activity
dingxiangfei2009 commentedon Apr 18, 2024
@rustbot claim
dingxiangfei2009 commentedon May 4, 2024
Update: #107251 has been repurposed for this edition change.
Auto merge of rust-lang#129466 - dingxiangfei2009:let-chain-lint-crat…
Auto merge of rust-lang#129466 - dingxiangfei2009:let-chain-lint-crat…
Auto merge of rust-lang#129466 - dingxiangfei2009:let-chain-lint-crat…
Auto merge of rust-lang#129466 - dingxiangfei2009:let-chain-lint-crat…
Auto merge of rust-lang#107251 - dingxiangfei2009:let-chain-rescope, …
25 remaining items
Disable `rust_2024_compatibility` lint option
Auto merge of rust-lang#132666 - dingxiangfei2009:skip-if-let-rescope…
Disable `rust_2024_compatibility` lint option (#9615)
Disable `rust_2024_compatibility` lint option (#9615)
Disable `rust_2024_compatibility` lint option (#9615)
traviscross commentedon Nov 26, 2024
@rustbot labels +S-tracking-ready-for-edition
On the edition side, we've reviewed this item, and it's now ready for Rust 2024.
Huge thanks to @dingxiangfei2009 for his great work on pushing this item forward and getting it done.
Auto merge of rust-lang#132666 - dingxiangfei2009:skip-if-let-rescope…
Auto merge of rust-lang#132833 - est31:stabilize_let_chains, r=fee1-dead
Auto merge of #132833 - est31:stabilize_let_chains, r=fee1-dead
Auto merge of #132833 - est31:stabilize_let_chains, r=fee1-dead
Disable `rust_2024_compatibility` lint option (neondatabase#9615)