Skip to content
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

Tracking Issue for #![feature(const_cell_into_inner)] #78729

Open
3 of 4 tasks
Tracked by #3
a1phyr opened this issue Nov 4, 2020 · 6 comments
Open
3 of 4 tasks
Tracked by #3

Tracking Issue for #![feature(const_cell_into_inner)] #78729

a1phyr opened this issue Nov 4, 2020 · 6 comments
Labels
A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. 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. Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@a1phyr
Copy link
Contributor

a1phyr commented Nov 4, 2020

This is a tracking issue for #![feature(const_cell_into_inner)].

Constantified functions are:

  • UnsafeCell::into_inner
  • Cell::into_inner
  • RefCell::into_inner
  • OnceCell::into_inner
  • Atomic*::into_inner (done)

Steps

@a1phyr a1phyr added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Nov 4, 2020
@LeSeulArtichaut LeSeulArtichaut added A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Nov 4, 2020
@KodrAus KodrAus added the Libs-Tracked Libs issues that are tracked on the team's project board. label Nov 6, 2020
m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 7, 2020
…lnay

Constantify `UnsafeCell::into_inner` and related

Tracking issue: rust-lang#78729

This PR constantifies:
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `Atomic*::into_inner`

r? `@dtolnay`
m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 7, 2020
…lnay

Constantify `UnsafeCell::into_inner` and related

Tracking issue: rust-lang#78729

This PR constantifies:
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `Atomic*::into_inner`

r? ``@dtolnay``
m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 7, 2020
…lnay

Constantify `UnsafeCell::into_inner` and related

Tracking issue: rust-lang#78729

This PR constantifies:
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `Atomic*::into_inner`

r? ```@dtolnay```
m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 7, 2020
…lnay

Constantify `UnsafeCell::into_inner` and related

Tracking issue: rust-lang#78729

This PR constantifies:
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `Atomic*::into_inner`

r? ````@dtolnay````
m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 8, 2020
…lnay

Constantify `UnsafeCell::into_inner` and related

Tracking issue: rust-lang#78729

This PR constantifies:
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `Atomic*::into_inner`

r? `````@dtolnay`````
@m-ou-se
Copy link
Member

m-ou-se commented Mar 31, 2021

@rfcbot merge

cc @rust-lang/wg-const-eval

@rfcbot
Copy link

rfcbot commented Mar 31, 2021

Team member @m-ou-se 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.

@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. labels Mar 31, 2021
@rfcbot
Copy link

rfcbot commented Mar 31, 2021

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

@rfcbot rfcbot added 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 Mar 31, 2021
@rfcbot rfcbot added the finished-final-comment-period The final comment period is finished for this PR / Issue. label Apr 10, 2021
@rfcbot
Copy link

rfcbot commented Apr 10, 2021

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.

The RFC will be merged soon.

@rfcbot rfcbot added 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 10, 2021
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Apr 15, 2021
@dtolnay
Copy link
Member

dtolnay commented Apr 5, 2024

According to #84087 (comment), this is blocked on the "precise drop analysis" unstable const feature (#73255).

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 6, 2024
…lstrieb

Stabilize const Atomic*::into_inner

Partial stabilization for rust-lang#78729, for which the FCP has already completed.

The other `into_inner` functions in that tracking issue (`UnsafeCell`, `Cell`, `RefCell`) are blocked on rust-lang#73255 for now.

```console
error[E0493]: destructor of `UnsafeCell<T>` cannot be evaluated at compile-time
    --> library/core/src/cell.rs:2076:29
     |
2076 |     pub const fn into_inner(self) -> T {
     |                             ^^^^ the destructor for this type cannot be evaluated in constant functions
2077 |         self.value
2078 |     }
     |     - value is dropped here
```
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 7, 2024
Rollup merge of rust-lang#123522 - dtolnay:constatomicintoinner, r=Nilstrieb

Stabilize const Atomic*::into_inner

Partial stabilization for rust-lang#78729, for which the FCP has already completed.

The other `into_inner` functions in that tracking issue (`UnsafeCell`, `Cell`, `RefCell`) are blocked on rust-lang#73255 for now.

```console
error[E0493]: destructor of `UnsafeCell<T>` cannot be evaluated at compile-time
    --> library/core/src/cell.rs:2076:29
     |
2076 |     pub const fn into_inner(self) -> T {
     |                             ^^^^ the destructor for this type cannot be evaluated in constant functions
2077 |         self.value
2078 |     }
     |     - value is dropped here
```
tgross35 added a commit to tgross35/rust that referenced this issue Aug 21, 2024
`Cell` and `RefCell` have their `into_inner` methods const unstable.
`OnceCell` has the same logic, so add it under the same gate.

Tracking issue: rust-lang#78729
@tgross35
Copy link
Contributor

Since this is still blocked, I made OnceCell::into_inner const under the same gate in #129382.

jieyouxu added a commit to jieyouxu/rust that referenced this issue Aug 22, 2024
…r, r=Noratrieb

Add `const_cell_into_inner` to `OnceCell`

`Cell` and `RefCell` have their `into_inner` methods const unstable. `OnceCell` has the same logic, so add it under the same gate.

Tracking issue: rust-lang#78729
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 22, 2024
…r, r=Noratrieb

Add `const_cell_into_inner` to `OnceCell`

`Cell` and `RefCell` have their `into_inner` methods const unstable. `OnceCell` has the same logic, so add it under the same gate.

Tracking issue: rust-lang#78729
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 22, 2024
Rollup merge of rust-lang#129382 - tgross35:once-cell-const-into-inner, r=Noratrieb

Add `const_cell_into_inner` to `OnceCell`

`Cell` and `RefCell` have their `into_inner` methods const unstable. `OnceCell` has the same logic, so add it under the same gate.

Tracking issue: rust-lang#78729
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 29, 2024
…dtolnay

stabilize const_cell_into_inner

This const-stabilizes
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `OnceCell::into_inner`

`@rust-lang/wg-const-eval` this uses `rustc_allow_const_fn_unstable(const_precise_live_drops)`, so we'd be comitting to always finding *some* way to accept this code. IMO that's fine -- what these functions do is to move out the only field of a struct, and that struct has no destructor itself. The field's destructor does not get run as it gets returned to the caller.

`@rust-lang/libs-api` this was FCP'd already [years ago](rust-lang#78729 (comment)), except that  `OnceCell::into_inner` was added to the same feature gate since then (Cc `@tgross35).` Does that mean we have to re-run the FCP? If yes, I'd honestly prefer to move `OnceCell` into its own feature gate to not risk missing the next release. (That's why it's not great to add new functions to an already FCP'd feature gate.) OTOH if this needs an FCP either way since the previous FCP was so long ago, then we might as well do it all at once.
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 29, 2024
Rollup merge of rust-lang#130972 - RalfJung:const_cell_into_inner, r=dtolnay

stabilize const_cell_into_inner

This const-stabilizes
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `OnceCell::into_inner`

`@rust-lang/wg-const-eval` this uses `rustc_allow_const_fn_unstable(const_precise_live_drops)`, so we'd be comitting to always finding *some* way to accept this code. IMO that's fine -- what these functions do is to move out the only field of a struct, and that struct has no destructor itself. The field's destructor does not get run as it gets returned to the caller.

`@rust-lang/libs-api` this was FCP'd already [years ago](rust-lang#78729 (comment)), except that  `OnceCell::into_inner` was added to the same feature gate since then (Cc `@tgross35).` Does that mean we have to re-run the FCP? If yes, I'd honestly prefer to move `OnceCell` into its own feature gate to not risk missing the next release. (That's why it's not great to add new functions to an already FCP'd feature gate.) OTOH if this needs an FCP either way since the previous FCP was so long ago, then we might as well do it all at once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. 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. Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants