Skip to content

Commit

Permalink
Rollup merge of rust-lang#124012 - slanterns:as_slice_stabilize, r=Bu…
Browse files Browse the repository at this point in the history
…rntSushi

Stabilize `binary_heap_as_slice`

This PR stabilizes `binary_heap_as_slice`:

```rust
// std::collections::BinaryHeap

impl BinaryHeap<T> {
    pub fn as_slice(&self) -> &[T]
}
```

<br>

Tracking issue: rust-lang#83659.
Implementation PR: rust-lang#82331.

FCPs already completed in the tracking issue.

Closes rust-lang#83659.

r? libs-api
  • Loading branch information
matthiaskrgr authored Jun 7, 2024
2 parents 05a92c2 + dbd03d4 commit 8a4b11a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,6 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
/// Basic usage:
///
/// ```
/// #![feature(binary_heap_as_slice)]
/// use std::collections::BinaryHeap;
/// use std::io::{self, Write};
///
Expand All @@ -1225,7 +1224,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
/// io::sink().write(heap.as_slice()).unwrap();
/// ```
#[must_use]
#[unstable(feature = "binary_heap_as_slice", issue = "83659")]
#[stable(feature = "binary_heap_as_slice", since = "CURRENT_RUSTC_VERSION")]
pub fn as_slice(&self) -> &[T] {
self.data.as_slice()
}
Expand Down
1 change: 0 additions & 1 deletion alloc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#![feature(binary_heap_into_iter_sorted)]
#![feature(binary_heap_drain_sorted)]
#![feature(slice_ptr_get)]
#![feature(binary_heap_as_slice)]
#![feature(inplace_iteration)]
#![feature(iter_advance_by)]
#![feature(iter_next_chunk)]
Expand Down

0 comments on commit 8a4b11a

Please sign in to comment.