Skip to content

Commit c9d2d3c

Browse files
committed
Add tracking issues (const_box, const_alloc_error)
1 parent eb4fc64 commit c9d2d3c

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

Diff for: library/alloc/src/alloc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
323323

324324
#[cfg_attr(not(test), lang = "box_free")]
325325
#[inline]
326-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
326+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
327327
// This signature has to be the same as `Box`, otherwise an ICE will happen.
328328
// When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as
329329
// well.
@@ -365,7 +365,7 @@ extern "Rust" {
365365
/// [`set_alloc_error_hook`]: ../../std/alloc/fn.set_alloc_error_hook.html
366366
/// [`take_alloc_error_hook`]: ../../std/alloc/fn.take_alloc_error_hook.html
367367
#[stable(feature = "global_alloc", since = "1.28.0")]
368-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
368+
#[rustc_const_unstable(feature = "const_alloc_error", issue = "92523")]
369369
#[cfg(all(not(no_global_oom_handling), not(test)))]
370370
#[rustc_allocator_nounwind]
371371
#[cold]

Diff for: library/alloc/src/boxed.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<T, A: Allocator> Box<T, A> {
346346
/// ```
347347
#[cfg(not(no_global_oom_handling))]
348348
#[unstable(feature = "allocator_api", issue = "32838")]
349-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
349+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
350350
#[must_use]
351351
#[inline]
352352
pub const fn new_in(x: T, alloc: A) -> Self
@@ -376,7 +376,7 @@ impl<T, A: Allocator> Box<T, A> {
376376
/// # Ok::<(), std::alloc::AllocError>(())
377377
/// ```
378378
#[unstable(feature = "allocator_api", issue = "32838")]
379-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
379+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
380380
#[inline]
381381
pub const fn try_new_in(x: T, alloc: A) -> Result<Self, AllocError>
382382
where
@@ -411,7 +411,7 @@ impl<T, A: Allocator> Box<T, A> {
411411
/// assert_eq!(*five, 5)
412412
/// ```
413413
#[unstable(feature = "allocator_api", issue = "32838")]
414-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
414+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
415415
#[cfg(not(no_global_oom_handling))]
416416
#[must_use]
417417
// #[unstable(feature = "new_uninit", issue = "63291")]
@@ -452,7 +452,7 @@ impl<T, A: Allocator> Box<T, A> {
452452
/// ```
453453
#[unstable(feature = "allocator_api", issue = "32838")]
454454
// #[unstable(feature = "new_uninit", issue = "63291")]
455-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
455+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
456456
pub const fn try_new_uninit_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError>
457457
where
458458
A: ~const Allocator + ~const Drop,
@@ -483,7 +483,7 @@ impl<T, A: Allocator> Box<T, A> {
483483
///
484484
/// [zeroed]: mem::MaybeUninit::zeroed
485485
#[unstable(feature = "allocator_api", issue = "32838")]
486-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
486+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
487487
#[cfg(not(no_global_oom_handling))]
488488
// #[unstable(feature = "new_uninit", issue = "63291")]
489489
#[must_use]
@@ -524,7 +524,7 @@ impl<T, A: Allocator> Box<T, A> {
524524
/// [zeroed]: mem::MaybeUninit::zeroed
525525
#[unstable(feature = "allocator_api", issue = "32838")]
526526
// #[unstable(feature = "new_uninit", issue = "63291")]
527-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
527+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
528528
pub const fn try_new_zeroed_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError>
529529
where
530530
A: ~const Allocator + ~const Drop,
@@ -538,7 +538,7 @@ impl<T, A: Allocator> Box<T, A> {
538538
/// `x` will be pinned in memory and unable to be moved.
539539
#[cfg(not(no_global_oom_handling))]
540540
#[unstable(feature = "allocator_api", issue = "32838")]
541-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
541+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
542542
#[must_use]
543543
#[inline(always)]
544544
pub const fn pin_in(x: T, alloc: A) -> Pin<Self>
@@ -552,7 +552,7 @@ impl<T, A: Allocator> Box<T, A> {
552552
///
553553
/// This conversion does not allocate on the heap and happens in place.
554554
#[unstable(feature = "box_into_boxed_slice", issue = "71582")]
555-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
555+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
556556
pub const fn into_boxed_slice(boxed: Self) -> Box<[T], A> {
557557
let (raw, alloc) = Box::into_raw_with_allocator(boxed);
558558
unsafe { Box::from_raw_in(raw as *mut [T; 1], alloc) }
@@ -570,7 +570,7 @@ impl<T, A: Allocator> Box<T, A> {
570570
/// assert_eq!(Box::into_inner(c), 5);
571571
/// ```
572572
#[unstable(feature = "box_into_inner", issue = "80437")]
573-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
573+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
574574
#[inline]
575575
pub const fn into_inner(boxed: Self) -> T
576576
where
@@ -789,7 +789,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
789789
/// assert_eq!(*five, 5)
790790
/// ```
791791
#[unstable(feature = "new_uninit", issue = "63291")]
792-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
792+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
793793
#[inline]
794794
pub const unsafe fn assume_init(self) -> Box<T, A> {
795795
let (raw, alloc) = Box::into_raw_with_allocator(self);
@@ -824,7 +824,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
824824
/// }
825825
/// ```
826826
#[unstable(feature = "new_uninit", issue = "63291")]
827-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
827+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
828828
#[inline]
829829
pub const fn write(mut boxed: Self, value: T) -> Box<T, A> {
830830
unsafe {
@@ -971,7 +971,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
971971
/// [memory layout]: self#memory-layout
972972
/// [`Layout`]: crate::Layout
973973
#[unstable(feature = "allocator_api", issue = "32838")]
974-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
974+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
975975
#[inline]
976976
pub const unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self {
977977
Box(unsafe { Unique::new_unchecked(raw) }, alloc)
@@ -1069,7 +1069,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
10691069
///
10701070
/// [memory layout]: self#memory-layout
10711071
#[unstable(feature = "allocator_api", issue = "32838")]
1072-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1072+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
10731073
#[inline]
10741074
pub const fn into_raw_with_allocator(b: Self) -> (*mut T, A) {
10751075
let (leaked, alloc) = Box::into_unique(b);
@@ -1081,7 +1081,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
10811081
issue = "none",
10821082
reason = "use `Box::leak(b).into()` or `Unique::from(Box::leak(b))` instead"
10831083
)]
1084-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1084+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
10851085
#[inline]
10861086
#[doc(hidden)]
10871087
pub const fn into_unique(b: Self) -> (Unique<T>, A) {
@@ -1100,7 +1100,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
11001100
/// to call it as `Box::allocator(&b)` instead of `b.allocator()`. This
11011101
/// is so that there is no conflict with a method on the inner type.
11021102
#[unstable(feature = "allocator_api", issue = "32838")]
1103-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1103+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
11041104
#[inline]
11051105
pub const fn allocator(b: &Self) -> &A {
11061106
&b.1
@@ -1142,7 +1142,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
11421142
/// assert_eq!(*static_ref, [4, 2, 3]);
11431143
/// ```
11441144
#[stable(feature = "box_leak", since = "1.26.0")]
1145-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1145+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
11461146
#[inline]
11471147
pub const fn leak<'a>(b: Self) -> &'a mut T
11481148
where
@@ -1157,7 +1157,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
11571157
///
11581158
/// This is also available via [`From`].
11591159
#[unstable(feature = "box_into_pin", issue = "62370")]
1160-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1160+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
11611161
pub const fn into_pin(boxed: Self) -> Pin<Self>
11621162
where
11631163
A: 'static,
@@ -1170,7 +1170,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
11701170
}
11711171

11721172
#[stable(feature = "rust1", since = "1.0.0")]
1173-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1173+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
11741174
unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> const Drop for Box<T, A> {
11751175
fn drop(&mut self) {
11761176
// FIXME: Do nothing, drop is currently performed by compiler.
@@ -1381,7 +1381,7 @@ impl<T> From<T> for Box<T> {
13811381
}
13821382

13831383
#[stable(feature = "pin", since = "1.33.0")]
1384-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1384+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
13851385
impl<T: ?Sized, A: Allocator> const From<Box<T, A>> for Pin<Box<T, A>>
13861386
where
13871387
A: 'static,
@@ -1761,7 +1761,7 @@ impl<T: ?Sized, A: Allocator> fmt::Pointer for Box<T, A> {
17611761
}
17621762

17631763
#[stable(feature = "rust1", since = "1.0.0")]
1764-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1764+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
17651765
impl<T: ?Sized, A: Allocator> const Deref for Box<T, A> {
17661766
type Target = T;
17671767

@@ -1771,7 +1771,7 @@ impl<T: ?Sized, A: Allocator> const Deref for Box<T, A> {
17711771
}
17721772

17731773
#[stable(feature = "rust1", since = "1.0.0")]
1774-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1774+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
17751775
impl<T: ?Sized, A: Allocator> const DerefMut for Box<T, A> {
17761776
fn deref_mut(&mut self) -> &mut T {
17771777
&mut **self
@@ -1951,7 +1951,7 @@ impl<T: ?Sized, A: Allocator> AsMut<T> for Box<T, A> {
19511951
* could have a method to project a Pin<T> from it.
19521952
*/
19531953
#[stable(feature = "pin", since = "1.33.0")]
1954-
#[rustc_const_unstable(feature = "const_box", issue = "none")]
1954+
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
19551955
impl<T: ?Sized, A: Allocator> const Unpin for Box<T, A> where A: 'static {}
19561956

19571957
#[unstable(feature = "generator_trait", issue = "43122")]

Diff for: library/alloc/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@
9696
#![feature(array_windows)]
9797
#![feature(async_stream)]
9898
#![feature(coerce_unsized)]
99-
#![cfg_attr(not(no_global_oom_handling), feature(const_btree_new))]
99+
#![feature(const_alloc_error)]
100100
#![feature(const_box)]
101+
#![cfg_attr(not(no_global_oom_handling), feature(const_btree_new))]
101102
#![feature(const_cow_is_borrowed)]
102103
#![feature(const_convert)]
103104
#![feature(const_size_of_val)]

0 commit comments

Comments
 (0)