Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3d8b21b

Browse files
authoredMar 24, 2025
Rollup merge of rust-lang#138800 - RalfJung:const_box, r=oli-obk
remove remnants of const_box feature This feature requires major design work, and the few methods it gates currently aren't actually useful. Let's reset to a clean slate so when a design materializes, we can start from scratch. Closes rust-lang#92521 by removing the feature it tracks. r? `@oli-obk`
2 parents 9af08ea + 7b9d5b8 commit 3d8b21b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed
 

‎library/alloc/src/boxed.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1149,9 +1149,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
11491149
///
11501150
/// [memory layout]: self#memory-layout
11511151
#[unstable(feature = "allocator_api", issue = "32838")]
1152-
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
11531152
#[inline]
1154-
pub const unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self {
1153+
pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self {
11551154
Box(unsafe { Unique::new_unchecked(raw) }, alloc)
11561155
}
11571156

@@ -1203,9 +1202,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
12031202
/// [memory layout]: self#memory-layout
12041203
#[unstable(feature = "allocator_api", issue = "32838")]
12051204
// #[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
1206-
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
12071205
#[inline]
1208-
pub const unsafe fn from_non_null_in(raw: NonNull<T>, alloc: A) -> Self {
1206+
pub unsafe fn from_non_null_in(raw: NonNull<T>, alloc: A) -> Self {
12091207
// SAFETY: guaranteed by the caller.
12101208
unsafe { Box::from_raw_in(raw.as_ptr(), alloc) }
12111209
}
@@ -1550,9 +1548,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
15501548
/// to call it as `Box::allocator(&b)` instead of `b.allocator()`. This
15511549
/// is so that there is no conflict with a method on the inner type.
15521550
#[unstable(feature = "allocator_api", issue = "32838")]
1553-
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
15541551
#[inline]
1555-
pub const fn allocator(b: &Self) -> &A {
1552+
pub fn allocator(b: &Self) -> &A {
15561553
&b.1
15571554
}
15581555

@@ -1639,8 +1636,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
16391636
/// let bar = Pin::from(foo);
16401637
/// ```
16411638
#[stable(feature = "box_into_pin", since = "1.63.0")]
1642-
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
1643-
pub const fn into_pin(boxed: Self) -> Pin<Self>
1639+
pub fn into_pin(boxed: Self) -> Pin<Self>
16441640
where
16451641
A: 'static,
16461642
{

0 commit comments

Comments
 (0)
Failed to load comments.