Skip to content

Commit 3acb36a

Browse files
committed
Stabilize const_fn_union
1 parent 3f94afe commit 3acb36a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
#![feature(const_refs_to_cell)]
8787
#![feature(const_panic)]
8888
#![feature(const_pin)]
89-
#![feature(const_fn_union)]
89+
#![cfg_attr(bootstrap, feature(const_fn_union))]
9090
#![feature(const_impl_trait)]
9191
#![feature(const_fn_floating_point_arithmetic)]
9292
#![feature(const_fn_fn_ptr_basics)]

core/src/slice/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<T> [T] {
100100
#[rustc_const_stable(feature = "const_slice_len", since = "1.39.0")]
101101
#[inline]
102102
// SAFETY: const sound because we transmute out the length field as a usize (which it must be)
103-
#[rustc_allow_const_fn_unstable(const_fn_union)]
103+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_union))]
104104
pub const fn len(&self) -> usize {
105105
// FIXME: Replace with `crate::ptr::metadata(self)` when that is const-stable.
106106
// As of this writing this causes a "Const-stable functions can only call other

0 commit comments

Comments
 (0)