-
Notifications
You must be signed in to change notification settings - Fork 13.3k
stabilize const_cell #137928
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
stabilize const_cell #137928
Conversation
@rfcbot fcp merge |
Team member @dtolnay 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. |
@Amanieu @BurntSushi @joshtriplett friendly FCP checkbox reminder :) |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
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. |
@bors r+ |
stabilize const_cell `@rust-lang/libs-api` `@rust-lang/wg-const-eval` I see no reason to wait any longer, so I propose we stabilize the use of `Cell` in `const fn` -- specifically the APIs listed here: ```rust // core::cell impl<T> Cell<T> { pub const fn replace(&self, val: T) -> T; } impl<T: Copy> Cell<T> { pub const fn get(&self) -> T; } impl<T: ?Sized> Cell<T> { pub const fn get_mut(&mut self) -> &mut T; pub const fn from_mut(t: &mut T) -> &Cell<T>; } impl<T> Cell<[T]> { pub const fn as_slice_of_cells(&self) -> &[Cell<T>]; } ``` Unfortunately, `set` cannot be made `const fn` yet as it drops the old contents. Fixes rust-lang#131283
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139060 (replace commit placeholder in vendor status with actual commit) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137928 - RalfJung:const_cell, r=m-ou-se stabilize const_cell ``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval`` I see no reason to wait any longer, so I propose we stabilize the use of `Cell` in `const fn` -- specifically the APIs listed here: ```rust // core::cell impl<T> Cell<T> { pub const fn replace(&self, val: T) -> T; } impl<T: Copy> Cell<T> { pub const fn get(&self) -> T; } impl<T: ?Sized> Cell<T> { pub const fn get_mut(&mut self) -> &mut T; pub const fn from_mut(t: &mut T) -> &Cell<T>; } impl<T> Cell<[T]> { pub const fn as_slice_of_cells(&self) -> &[Cell<T>]; } ``` Unfortunately, `set` cannot be made `const fn` yet as it drops the old contents. Fixes rust-lang#131283
stabilize const_cell ``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval`` I see no reason to wait any longer, so I propose we stabilize the use of `Cell` in `const fn` -- specifically the APIs listed here: ```rust // core::cell impl<T> Cell<T> { pub const fn replace(&self, val: T) -> T; } impl<T: Copy> Cell<T> { pub const fn get(&self) -> T; } impl<T: ?Sized> Cell<T> { pub const fn get_mut(&mut self) -> &mut T; pub const fn from_mut(t: &mut T) -> &Cell<T>; } impl<T> Cell<[T]> { pub const fn as_slice_of_cells(&self) -> &[Cell<T>]; } ``` Unfortunately, `set` cannot be made `const fn` yet as it drops the old contents. Fixes rust-lang#131283
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
@rust-lang/libs-api @rust-lang/wg-const-eval I see no reason to wait any longer, so I propose we stabilize the use of
Cell
inconst fn
-- specifically the APIs listed here:Unfortunately,
set
cannot be madeconst fn
yet as it drops the old contents.Fixes #131283