Skip to content

Stabilize local_key_cell_update#157734

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
tgross35:stabilize-local_key_cell_update
Jul 6, 2026
Merged

Stabilize local_key_cell_update#157734
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
tgross35:stabilize-local_key_cell_update

Conversation

@tgross35

@tgross35 tgross35 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Newly stable API:

impl<T: 'static> LocalKey<Cell<T>> {
    pub fn update(&'static self, f: impl FnOnce(T) -> T)
    where
        T: Copy;
}

This matches the signature on Cell.

Closes: https://www.github.com/rust-lang/rust/issues/143989 (Tracking issue)

tgross35 added 2 commits June 10, 2026 20:35
The disclaimers relevant for other `LocalKey` methods are relevant for
`update`, so add them to the documentation.
Newly stable API:

    impl<T: 'static> LocalKey<Cell<T>> {
        pub fn update(&'static self, f: impl FnOnce(T) -> T)
        where
            T: Copy;
    }

This matches the signature on `Cell`.

Tracking issue: RUST-143989
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 11, 2026
@rustbot

rustbot commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 11 candidates
  • Random selection from Mark-Simulacrum, clarfonthey, jhpratt

@tgross35

Copy link
Copy Markdown
Contributor Author

This has been around for close to a year and is pretty straightforward, similar to existing stable methods on LocalKey<Cell<T>> that predate the stability of Cell::update.

@rustbot label +I-libs-api-nominated

@rustbot rustbot added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jun 11, 2026
@jhpratt jhpratt linked an issue Jun 11, 2026 that may be closed by this pull request
3 tasks

@jhpratt jhpratt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me after FCP completion

View changes since this review

@jhpratt jhpratt added S-waiting-on-t-libs-api Status: Awaiting decision from T-libs-api T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 11, 2026
@joshtriplett

Copy link
Copy Markdown
Member

Seems reasonable, and consistent with other methods.

@rfcbot merge libs-api

@rust-rfcbot

rust-rfcbot commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

@joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Jun 23, 2026
@tgross35

Copy link
Copy Markdown
Contributor Author

@joshtriplett there's a FCP proposal at #143989 (comment). If votes are merged then that's enough to start :)

@Amanieu

Amanieu commented Jun 30, 2026

Copy link
Copy Markdown
Member

@rfcbot cancel

@rust-rfcbot

Copy link
Copy Markdown
Collaborator

@Amanieu proposal cancelled.

@rust-rfcbot rust-rfcbot removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Jun 30, 2026
@Amanieu Amanieu removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jun 30, 2026
@Amanieu

Amanieu commented Jun 30, 2026

Copy link
Copy Markdown
Member

Cancelling in favor of the FCP in the tracking issue.

@tgross35

tgross35 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

FCP complete at #143989 (comment),

@bors r=jhpratt rollup

@rust-bors

rust-bors Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

📋 This PR cannot be approved because it currently has the following label: S-waiting-on-t-libs-api.

@tgross35 tgross35 removed the S-waiting-on-t-libs-api Status: Awaiting decision from T-libs-api label Jul 5, 2026
@tgross35

tgross35 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=jhpratt rollup

@rust-bors

rust-bors Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ef5968d has been approved by jhpratt

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 2. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 5, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 6, 2026
…update, r=jhpratt

Stabilize `local_key_cell_update`

Newly stable API:

```rust
impl<T: 'static> LocalKey<Cell<T>> {
    pub fn update(&'static self, f: impl FnOnce(T) -> T)
    where
        T: Copy;
}
```

This matches the signature on `Cell`.

Closes: https://www.github.com/rust-lang/rust/issues/143989 (Tracking issue)
rust-bors Bot pushed a commit that referenced this pull request Jul 6, 2026
Rollup of 20 pull requests

Successful merges:

 - #158377 (add `-Zforce-intrinsic-fallback` flag)
 - #158642 (Clarify some interning details)
 - #158743 (Look for cdb location in the registry first)
 - #158775 (bootstrap: only encode RUSTFLAGS when a flag contains a space)
 - #158782 (Add and use cfg(target_has_threads) to enforce no_thread impl usage)
 - #158785 (hook intrinsic-test into aarch64-gnu)
 - #157734 (Stabilize `local_key_cell_update`)
 - #158183 (std: allocate less memory in `current_exe` for OpenBSD)
 - #158671 (Move tests batch 17)
 - #158730 (Update `FIXME(static_mut_refs)` comments)
 - #158752 (Reorganize `tests/ui/issues` [18/N])
 - #158755 (Use `ThinVec` more in the AST)
 - #158757 (Fix incorrect tracking issue for `read_le`/`read_be`)
 - #158765 (Fix ICE on non-ident path in `doc(auto_cfg values)`)
 - #158771 (library: expand HashSet::extract_if coverage)
 - #158772 (rustc-dev-guide subtree update)
 - #158776 (fix: emit diagnostic for AVR target without target-cpu)
 - #158786 (Add regression test for builtin attr macro values)
 - #158807 (Add regression test for CString::clone_into unwind safety)
 - #158825 (Fix typo)
rust-bors Bot pushed a commit that referenced this pull request Jul 6, 2026
Rollup of 24 pull requests

Successful merges:

 - #158377 (add `-Zforce-intrinsic-fallback` flag)
 - #158642 (Clarify some interning details)
 - #158694 (Positive test for closures needing expectations)
 - #158743 (Look for cdb location in the registry first)
 - #158775 (bootstrap: only encode RUSTFLAGS when a flag contains a space)
 - #158782 (Add and use cfg(target_has_threads) to enforce no_thread impl usage)
 - #158785 (hook intrinsic-test into aarch64-gnu)
 - #158819 (Put `InhabitedPredicate::NotInModule` earlier in disjunction since it can be a lot faster)
 - #157734 (Stabilize `local_key_cell_update`)
 - #158183 (std: allocate less memory in `current_exe` for OpenBSD)
 - #158310 (Remove unexpected usage of Unambig in non-infer variants)
 - #158671 (Move tests batch 17)
 - #158730 (Update `FIXME(static_mut_refs)` comments)
 - #158752 (Reorganize `tests/ui/issues` [18/N])
 - #158755 (Use `ThinVec` more in the AST)
 - #158757 (Fix incorrect tracking issue for `read_le`/`read_be`)
 - #158765 (Fix ICE on non-ident path in `doc(auto_cfg values)`)
 - #158771 (library: expand HashSet::extract_if coverage)
 - #158772 (rustc-dev-guide subtree update)
 - #158776 (fix: emit diagnostic for AVR target without target-cpu)
 - #158786 (Add regression test for builtin attr macro values)
 - #158810 (Add supplementary information for get_unchecked(mut))
 - #158825 (Fix typo)
 - #158838 (tidy: Use `empty_alternate = true` for triagebot mention glob check)
rust-bors Bot pushed a commit that referenced this pull request Jul 6, 2026
Rollup of 24 pull requests

Successful merges:

 - #158377 (add `-Zforce-intrinsic-fallback` flag)
 - #158642 (Clarify some interning details)
 - #158694 (Positive test for closures needing expectations)
 - #158743 (Look for cdb location in the registry first)
 - #158775 (bootstrap: only encode RUSTFLAGS when a flag contains a space)
 - #158782 (Add and use cfg(target_has_threads) to enforce no_thread impl usage)
 - #158785 (hook intrinsic-test into aarch64-gnu)
 - #158819 (Put `InhabitedPredicate::NotInModule` earlier in disjunction since it can be a lot faster)
 - #157734 (Stabilize `local_key_cell_update`)
 - #158183 (std: allocate less memory in `current_exe` for OpenBSD)
 - #158310 (Remove unexpected usage of Unambig in non-infer variants)
 - #158671 (Move tests batch 17)
 - #158730 (Update `FIXME(static_mut_refs)` comments)
 - #158752 (Reorganize `tests/ui/issues` [18/N])
 - #158755 (Use `ThinVec` more in the AST)
 - #158757 (Fix incorrect tracking issue for `read_le`/`read_be`)
 - #158765 (Fix ICE on non-ident path in `doc(auto_cfg values)`)
 - #158771 (library: expand HashSet::extract_if coverage)
 - #158772 (rustc-dev-guide subtree update)
 - #158776 (fix: emit diagnostic for AVR target without target-cpu)
 - #158786 (Add regression test for builtin attr macro values)
 - #158810 (Add supplementary information for get_unchecked(mut))
 - #158825 (Fix typo)
 - #158838 (tidy: Use `empty_alternate = true` for triagebot mention glob check)
rust-bors Bot pushed a commit that referenced this pull request Jul 6, 2026
Rollup of 24 pull requests

Successful merges:

 - #158377 (add `-Zforce-intrinsic-fallback` flag)
 - #158642 (Clarify some interning details)
 - #158694 (Positive test for closures needing expectations)
 - #158743 (Look for cdb location in the registry first)
 - #158775 (bootstrap: only encode RUSTFLAGS when a flag contains a space)
 - #158782 (Add and use cfg(target_has_threads) to enforce no_thread impl usage)
 - #158785 (hook intrinsic-test into aarch64-gnu)
 - #158819 (Put `InhabitedPredicate::NotInModule` earlier in disjunction since it can be a lot faster)
 - #157734 (Stabilize `local_key_cell_update`)
 - #158183 (std: allocate less memory in `current_exe` for OpenBSD)
 - #158310 (Remove unexpected usage of Unambig in non-infer variants)
 - #158671 (Move tests batch 17)
 - #158730 (Update `FIXME(static_mut_refs)` comments)
 - #158752 (Reorganize `tests/ui/issues` [18/N])
 - #158755 (Use `ThinVec` more in the AST)
 - #158757 (Fix incorrect tracking issue for `read_le`/`read_be`)
 - #158765 (Fix ICE on non-ident path in `doc(auto_cfg values)`)
 - #158771 (library: expand HashSet::extract_if coverage)
 - #158772 (rustc-dev-guide subtree update)
 - #158776 (fix: emit diagnostic for AVR target without target-cpu)
 - #158786 (Add regression test for builtin attr macro values)
 - #158810 (Add supplementary information for get_unchecked(mut))
 - #158825 (Fix typo)
 - #158838 (tidy: Use `empty_alternate = true` for triagebot mention glob check)
@rust-bors rust-bors Bot merged commit 04b47ed into rust-lang:main Jul 6, 2026
12 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for LocalKey<Cell>::update

6 participants