Skip to content

Commit

Permalink
Unrolled build for rust-lang#117316
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#117316 - Coekjan:const-binary-heap-constructor, r=dtolnay

Mark constructor of `BinaryHeap` as const fn

rust-lang#112353
  • Loading branch information
rust-timer authored Oct 29, 2023
2 parents 2cad938 + 4dd7568 commit 468d0f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,9 @@ 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")]
#[must_use]
pub fn new() -> BinaryHeap<T> {
pub const fn new() -> BinaryHeap<T> {
BinaryHeap { data: vec![] }
}

Expand Down Expand Up @@ -477,8 +478,9 @@ 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")]
#[must_use]
pub fn new_in(alloc: A) -> BinaryHeap<T, A> {
pub const fn new_in(alloc: A) -> BinaryHeap<T, A> {
BinaryHeap { data: Vec::new_in(alloc) }
}

Expand Down

0 comments on commit 468d0f8

Please sign in to comment.