diff --git a/alloc/src/lib.rs b/alloc/src/lib.rs index a67ea75825de3..f98c0cca1db47 100644 --- a/alloc/src/lib.rs +++ b/alloc/src/lib.rs @@ -114,7 +114,6 @@ #![feature(const_maybe_uninit_write)] #![feature(const_option)] #![feature(const_pin)] -#![feature(const_refs_to_cell)] #![feature(const_size_of_val)] #![feature(core_intrinsics)] #![feature(deprecated_suggestion)] @@ -165,6 +164,7 @@ // Language features: // tidy-alphabetical-start #![cfg_attr(bootstrap, feature(const_mut_refs))] +#![cfg_attr(bootstrap, feature(const_refs_to_cell))] #![cfg_attr(not(test), feature(coroutine_trait))] #![cfg_attr(test, feature(panic_update_hook))] #![cfg_attr(test, feature(test))] diff --git a/core/src/lib.rs b/core/src/lib.rs index d503e58423f85..058dcf3453279 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -192,6 +192,7 @@ // Language features: // tidy-alphabetical-start #![cfg_attr(bootstrap, feature(const_mut_refs))] +#![cfg_attr(bootstrap, feature(const_refs_to_cell))] #![feature(abi_unadjusted)] #![feature(adt_const_params)] #![feature(allow_internal_unsafe)] @@ -203,7 +204,6 @@ #![feature(cfg_ub_checks)] #![feature(const_for)] #![feature(const_precise_live_drops)] -#![feature(const_refs_to_cell)] #![feature(decl_macro)] #![feature(deprecated_suggestion)] #![feature(doc_cfg)] diff --git a/core/src/slice/mod.rs b/core/src/slice/mod.rs index c74a7666919b2..b1948ce69c77d 100644 --- a/core/src/slice/mod.rs +++ b/core/src/slice/mod.rs @@ -846,7 +846,7 @@ impl [T] { /// [`as_mut_ptr`]: slice::as_mut_ptr #[stable(feature = "slice_ptr_range", since = "1.48.0")] #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")] - #[rustc_allow_const_fn_unstable(const_mut_refs, const_refs_to_cell)] + #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs, const_refs_to_cell))] #[inline] #[must_use] pub const fn as_mut_ptr_range(&mut self) -> Range<*mut T> {