- Notifications
You must be signed in to change notification settings - Fork 13.8k
make RefCell unstably const #137843
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
make RefCell unstably const #137843
Conversation
ef5a67e
to ddc8777
Compare @rustbot label -T-libs +T-libs-api |
RefCell
unstably const
RefCell
unstably const
Cc @rust-lang/wg-const-eval |
The main problem is dropping. Please make sure to also add a test actually using a |
@compiler-errors what is the state of |
Since we probably all want to hear the answer to that question... cc @rust-lang/lang |
No. Until we know what const traits syntax to implement, adding more const trait impls is not something we want. The libstd churn is not worth it |
Yes |
@Daniel-Aaron-Bloom okay so please remove the |
Should I also remove try to remove my added private function |
Oh that's what those functions are for? Sure, seems fine to me as long no incomplete nightly features have to be enabled for this. |
06262da
to 484a39a
Compare ☔ The latest upstream changes (presumably #140646) made this pull request unmergeable. Please resolve the merge conflicts. |
484a39a
to 7b9bde3
Compare This comment has been minimized.
This comment has been minimized.
7b9bde3
to e11911c
Compare ☔ The latest upstream changes (presumably #141842) made this pull request unmergeable. Please resolve the merge conflicts. |
With #119899 this is unblocked |
e11911c
to bee3af2
Compare bee3af2
to 22b634d
Compare ☔ The latest upstream changes (presumably #142613) made this pull request unmergeable. Please resolve the merge conflicts. |
22b634d
to 1f1000f
Compare Thanks! @bors r+ |
…rors Rollup of 18 pull requests Successful merges: - #137843 (make RefCell unstably const) - #140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns) - #142549 (small iter.intersperse.fold() optimization) - #142637 (Remove some glob imports from the type system) - #142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation) - #142700 (Remove incorrect comments in `Weak`) - #142927 (Add note to `find_const_ty_from_env`) - #142967 (Fix RwLock::try_write documentation for WouldBlock condition) - #142986 (Port `#[export_name]` to the new attribute parsing infrastructure) - #143001 (Rename run always ) - #143010 (Update `browser-ui-test` version to `0.20.7`) - #143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`) - #143033 (Expand const-stabilized API links in relnotes) - #143041 (Remove cache for citool) - #143056 (Move an ACE test out of the GCI directory) - #143059 (Fix 1.88 relnotes) - #143067 (Tracking issue number for `iter_macro`) - #143073 (Fix some fixmes that were waiting for let chains) Failed merges: - #143020 (codegen_fn_attrs: make comment more precise) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #137843 - Daniel-Aaron-Bloom:const_cell, r=oli-obk make RefCell unstably const Now that we can do interior mutability in `const`, most of the `RefCell` API can be `const fn`. The main exceptions are APIs which use `FnOnce` (`RefCell::replace_with` and `Ref[Mut]::[filter_]map[_split]`) and `RefCell::take` which calls `Default::default`. Tracking issue: #137844
…li-obk make RefCell unstably const Now that we can do interior mutability in `const`, most of the `RefCell` API can be `const fn`. The main exceptions are APIs which use `FnOnce` (`RefCell::replace_with` and `Ref[Mut]::[filter_]map[_split]`) and `RefCell::take` which calls `Default::default`. Tracking issue: rust-lang#137844
…mpiler-errors Rollup of 18 pull requests Successful merges: - rust-lang#137843 (make RefCell unstably const) - rust-lang#140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns) - rust-lang#142549 (small iter.intersperse.fold() optimization) - rust-lang#142637 (Remove some glob imports from the type system) - rust-lang#142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation) - rust-lang#142700 (Remove incorrect comments in `Weak`) - rust-lang#142927 (Add note to `find_const_ty_from_env`) - rust-lang#142967 (Fix RwLock::try_write documentation for WouldBlock condition) - rust-lang#142986 (Port `#[export_name]` to the new attribute parsing infrastructure) - rust-lang#143001 (Rename run always ) - rust-lang#143010 (Update `browser-ui-test` version to `0.20.7`) - rust-lang#143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`) - rust-lang#143033 (Expand const-stabilized API links in relnotes) - rust-lang#143041 (Remove cache for citool) - rust-lang#143056 (Move an ACE test out of the GCI directory) - rust-lang#143059 (Fix 1.88 relnotes) - rust-lang#143067 (Tracking issue number for `iter_macro`) - rust-lang#143073 (Fix some fixmes that were waiting for let chains) Failed merges: - rust-lang#143020 (codegen_fn_attrs: make comment more precise) r? `@ghost` `@rustbot` modify labels: rollup
Now that we can do interior mutability in
const
, most of theRefCell
API can beconst fn
. The main exceptions are APIs which useFnOnce
(RefCell::replace_with
andRef[Mut]::[filter_]map[_split]
) andRefCell::take
which callsDefault::default
.Tracking issue: #137844