rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.27k stars 12.71k forks source link

Tracking Issue for Rust 2024: Rescope temporary lifetimes with respect to `else` #124085

Open traviscross opened 6 months ago

traviscross commented 6 months ago

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

Unresolved Questions

TODO.

Related

Implementation history

dingxiangfei2009 commented 6 months ago

@rustbot claim

dingxiangfei2009 commented 6 months ago

Update: #107251 has been repurposed for this edition change.