about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-01 07:10:55 +0000
committerbors <bors@rust-lang.org>2024-06-01 07:10:55 +0000
commit466be510af95d377a4e9997a6ab7c4db5f91e9ec (patch)
tree76c565db3a3bc2e2910740a240ad5e1fad4b00d0
parentdcc9a8f2831a9afd2896e3fe2cc020bb2bf949bd (diff)
parent7cee7c664befc25a4d3392e9fbdb6999b23b4619 (diff)
downloadrust-466be510af95d377a4e9997a6ab7c4db5f91e9ec.tar.gz
rust-466be510af95d377a4e9997a6ab7c4db5f91e9ec.zip
Auto merge of #125211 - Coekjan:const-binary-heap, r=jhpratt
Stablize `const_binary_heap_constructor`

This pr aims to stablize `const_binary_heap_constructor`.

`BinaryHeap::new` is able to be stablized, but `BinaryHeap::new_in` is not. Because the latter depends on `Vec::new_in` which is unstable.

The `const_binary_heap_constructor` feature contains the two functions, and I want to split this feature now. This pr creates `const_binary_heap_new_in` feature for `BinaryHeap::new_in` and stablizes `const_binary_heap_constructor` (now this original feature only contains one function).
-rw-r--r--library/alloc/src/collections/binary_heap/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/alloc/src/collections/binary_heap/mod.rs b/library/alloc/src/collections/binary_heap/mod.rs
index 846b9a1404d..0b04fb4a274 100644
--- a/library/alloc/src/collections/binary_heap/mod.rs
+++ b/library/alloc/src/collections/binary_heap/mod.rs
@@ -440,7 +440,10 @@ impl<T: Ord> BinaryHeap<T> {
     /// heap.push(4);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_binary_heap_constructor", issue = "112353")]
+    #[rustc_const_stable(
+        feature = "const_binary_heap_constructor",
+        since = "CURRENT_RUSTC_VERSION"
+    )]
     #[must_use]
     pub const fn new() -> BinaryHeap<T> {
         BinaryHeap { data: vec![] }
@@ -484,7 +487,7 @@ impl<T: Ord, A: Allocator> BinaryHeap<T, A> {
     /// heap.push(4);
     /// ```
     #[unstable(feature = "allocator_api", issue = "32838")]
-    #[rustc_const_unstable(feature = "const_binary_heap_constructor", issue = "112353")]
+    #[rustc_const_unstable(feature = "const_binary_heap_new_in", issue = "112353")]
     #[must_use]
     pub const fn new_in(alloc: A) -> BinaryHeap<T, A> {
         BinaryHeap { data: Vec::new_in(alloc) }