Skip to content

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

Closed

Description

@traviscross

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

Activity

  1. added
    T-langRelevant to the language team
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Apr 17, 2024
  2. dingxiangfei2009 commented on Apr 18, 2024

    @dingxiangfei2009
    Contributor

    @rustbot claim

  3. dingxiangfei2009 commented on May 4, 2024

    @dingxiangfei2009
    Contributor

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

  4. added 4 commits that reference this issue on Aug 25, 2024
  5. added a commit that references this issue on Sep 12, 2024
  6. 25 remaining items

  7. added a commit that references this issue on Nov 6, 2024
  8. traviscross commented on Nov 26, 2024

    @traviscross
    ContributorAuthor

    @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.

  9. added a commit that references this issue on Jan 23, 2025
  10. added a commit that references this issue on Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-edition-2024Area: The 2024 editionC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCL-if_let_rescopeLint: if_let_rescopeS-tracking-ready-for-editionStatus: This issue is ready for inclusion in the edition.T-langRelevant to the language team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions