Skip to content

Stabilize the cell_update feature #134446

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

Merged
merged 1 commit into from
Apr 24, 2025
Merged

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Dec 18, 2024

Included API:

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

FCP completed once at #50186 (comment) but the signature has since changed.

Closes: #50186

@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2024

r? @workingjubilee

rustbot has assigned @workingjubilee.
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

@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 Dec 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2024

The Miri subtree was changed

cc @rust-lang/miri

@tgross35
Copy link
Contributor Author

There was some continued discussion on the thread after FCP started. I don't think anything changed, but I'll request libs-api take a look to double check.

r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Dec 18, 2024
@rustbot rustbot assigned m-ou-se and unassigned workingjubilee Dec 18, 2024
@tgross35 tgross35 removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Dec 18, 2024
@GrigorenkoPV
Copy link
Contributor

Should we maybe change the signature from

    pub fn update<F>(&self, f: F) -> T
    where
        F: FnOnce(T) -> T,

to

    pub fn update(&self, f: impl FnOnce(T) -> T) -> T

analogous to #135956?

@bors
Copy link
Collaborator

bors commented Jan 27, 2025

☔ The latest upstream changes (presumably #135937) made this pull request unmergeable. Please resolve the merge conflicts.

@tgross35
Copy link
Contributor Author

tgross35 commented Mar 6, 2025

Nominating for libs-api to:

  1. Double check that the ~10 messages on the tracking issue since FCP started don't change any feelings about this API. The main discussion point is name and return value (old or new)
  2. Consider the signature change proposed above

@rustbot label +I-libs-api-nominated

@rustbot rustbot added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Mar 6, 2025
@m-ou-se m-ou-se added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2025
@Amanieu
Copy link
Member

Amanieu commented Apr 1, 2025

We discussed this in the @rust-lang/libs-api meeting last week and the conclusion was that:

  • We agree that the signature should use impl FnOnce instead of a generic parameter.
  • We think that update should not return a value. The rationale is that the semantics wouldn't be clear otherwise, and the value in the cell is Copy anyways so you can just call .get() before or after the update, which will result in clearer code.

Once those changes are made we will re-start the FCP for stabilization.

@Amanieu Amanieu removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Apr 1, 2025
@tgross35 tgross35 force-pushed the stabilize-cell_update branch from 6957c85 to db8f5eb Compare April 2, 2025 18:10
tgross35 added a commit to tgross35/rust that referenced this pull request Apr 2, 2025
Do the following:

* Switch to `impl FnOnce` rather than a generic `F`.
* Change `update` to return nothing.

This was discussed at a libs-api meeting [1].

Tracking issue: rust-lang#50186

[1]: rust-lang#134446 (comment)
@tgross35
Copy link
Contributor Author

tgross35 commented Apr 2, 2025

Thanks for taking a look. I'll leave this PR for stabilization only, API updates are in #139273.

m-ou-se added a commit to m-ou-se/rust that referenced this pull request Apr 3, 2025
…pratt

Apply requested API changes to `cell_update`

Do the following:

* Switch to `impl FnOnce` rather than a generic `F`.
* Change `update` to return nothing.

This was discussed at a libs-api meeting [1].

Tracking issue: rust-lang#50186

[1]: rust-lang#134446 (comment)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 3, 2025
…pratt

Apply requested API changes to `cell_update`

Do the following:

* Switch to `impl FnOnce` rather than a generic `F`.
* Change `update` to return nothing.

This was discussed at a libs-api meeting [1].

Tracking issue: rust-lang#50186

[1]: rust-lang#134446 (comment)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 3, 2025
Rollup merge of rust-lang#139273 - tgross35:cell-update-changes, r=jhpratt

Apply requested API changes to `cell_update`

Do the following:

* Switch to `impl FnOnce` rather than a generic `F`.
* Change `update` to return nothing.

This was discussed at a libs-api meeting [1].

Tracking issue: rust-lang#50186

[1]: rust-lang#134446 (comment)
Included API:

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

Closes: rust-lang#50186
@tgross35 tgross35 force-pushed the stabilize-cell_update branch from db8f5eb to ac34a6f Compare April 3, 2025 19:21
@tgross35 tgross35 added the needs-fcp This change is insta-stable, so needs a completed FCP to proceed. label Apr 3, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Apr 3, 2025

@Amanieu this should be ready for FCP now.

@Amanieu
Copy link
Member

Amanieu commented Apr 6, 2025

@rfcbot merge

@rfcbot 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. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Apr 6, 2025
@rfcbot
Copy link
Collaborator

rfcbot commented Apr 6, 2025

🔔 This is now entering its final comment period, as per the review above. 🔔

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 8, 2025
Do the following:

* Switch to `impl FnOnce` rather than a generic `F`.
* Change `update` to return nothing.

This was discussed at a libs-api meeting [1].

Tracking issue: rust-lang#50186

[1]: rust-lang#134446 (comment)
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 8, 2025
…pratt

Apply requested API changes to `cell_update`

Do the following:

* Switch to `impl FnOnce` rather than a generic `F`.
* Change `update` to return nothing.

This was discussed at a libs-api meeting [1].

Tracking issue: rust-lang#50186

[1]: rust-lang#134446 (comment)
@Amanieu Amanieu added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Apr 8, 2025
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Apr 16, 2025
@rfcbot
Copy link
Collaborator

rfcbot commented Apr 16, 2025

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@tgross35
Copy link
Contributor Author

libs-api completed FCP so this just needs libs review

r? libs

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Apr 24, 2025
@rustbot rustbot assigned thomcc and unassigned m-ou-se Apr 24, 2025
@jhpratt
Copy link
Member

jhpratt commented Apr 24, 2025

r? jhpratt

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 24, 2025

📌 Commit ac34a6f has been approved by jhpratt

It is now in the queue for this repository.

@rustbot rustbot assigned jhpratt and unassigned thomcc Apr 24, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 24, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#134446 (Stabilize the `cell_update` feature)
 - rust-lang#139307 (std: Add performance warnings to HashMap::get_disjoint_mut)
 - rust-lang#139450 (Impl new API `std::os::unix::fs::mkfifo` under feature `unix_fifo`)
 - rust-lang#139809 (Don't warn about `v128` in wasm ABI transition)
 - rust-lang#139852 (StableMIR: Implement `CompilerInterface`)
 - rust-lang#139945 (Extend HIR to track the source and syntax of a lifetime)
 - rust-lang#140028 (`deref_patterns`: support string and byte string literals in explicit `deref!("...")` patterns)
 - rust-lang#140181 (Remove `synstructure::Structure::underscore_const` calls.)
 - rust-lang#140232 (Remove unnecessary clones)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fdaa91a into rust-lang:master Apr 24, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 24, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2025
Rollup merge of rust-lang#134446 - tgross35:stabilize-cell_update, r=jhpratt

Stabilize the `cell_update` feature

Included API:

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

FCP completed once at rust-lang#50186 (comment) but the signature has since changed.

Closes: rust-lang#50186
@tgross35 tgross35 deleted the stabilize-cell_update branch April 24, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for Cell::update
10 participants