Skip to content

Commit dfe9326

Browse files
committed
Auto merge of #28148 - eefriedman:binary_heap, r=alexcrichton
2 parents 7780408 + b82c42c commit dfe9326

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

src/libcollections/binary_heap.rs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,14 @@ impl<T: Ord> BinaryHeap<T> {
214214
/// # Examples
215215
///
216216
/// ```
217-
/// #![feature(collections)]
217+
/// #![feature(binary_heap_extras)]
218218
///
219219
/// use std::collections::BinaryHeap;
220220
/// let heap = BinaryHeap::from_vec(vec![9, 1, 2, 7, 3, 2]);
221221
/// ```
222+
#[unstable(feature = "binary_heap_extras",
223+
reason = "needs to be audited",
224+
issue = "28147")]
222225
pub fn from_vec(vec: Vec<T>) -> BinaryHeap<T> {
223226
let mut heap = BinaryHeap { data: vec };
224227
let mut n = heap.len() / 2;
@@ -235,7 +238,7 @@ impl<T: Ord> BinaryHeap<T> {
235238
/// # Examples
236239
///
237240
/// ```
238-
/// #![feature(collections)]
241+
/// #![feature(binary_heap_extras)]
239242
///
240243
/// use std::collections::BinaryHeap;
241244
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);
@@ -341,7 +344,7 @@ impl<T: Ord> BinaryHeap<T> {
341344
/// # Examples
342345
///
343346
/// ```
344-
/// #![feature(collections)]
347+
/// #![feature(binary_heap_extras)]
345348
///
346349
/// use std::collections::BinaryHeap;
347350
/// let mut heap = BinaryHeap::from_vec(vec![1, 3]);
@@ -388,7 +391,7 @@ impl<T: Ord> BinaryHeap<T> {
388391
/// # Examples
389392
///
390393
/// ```
391-
/// #![feature(collections)]
394+
/// #![feature(binary_heap_extras)]
392395
///
393396
/// use std::collections::BinaryHeap;
394397
/// let mut heap = BinaryHeap::new();
@@ -400,6 +403,9 @@ impl<T: Ord> BinaryHeap<T> {
400403
/// assert_eq!(heap.len(), 2);
401404
/// assert_eq!(heap.peek(), Some(&3));
402405
/// ```
406+
#[unstable(feature = "binary_heap_extras",
407+
reason = "needs to be audited",
408+
issue = "28147")]
403409
pub fn push_pop(&mut self, mut item: T) -> T {
404410
match self.data.get_mut(0) {
405411
None => return item,
@@ -421,7 +427,7 @@ impl<T: Ord> BinaryHeap<T> {
421427
/// # Examples
422428
///
423429
/// ```
424-
/// #![feature(collections)]
430+
/// #![feature(binary_heap_extras)]
425431
///
426432
/// use std::collections::BinaryHeap;
427433
/// let mut heap = BinaryHeap::new();
@@ -431,6 +437,9 @@ impl<T: Ord> BinaryHeap<T> {
431437
/// assert_eq!(heap.len(), 1);
432438
/// assert_eq!(heap.peek(), Some(&3));
433439
/// ```
440+
#[unstable(feature = "binary_heap_extras",
441+
reason = "needs to be audited",
442+
issue = "28147")]
434443
pub fn replace(&mut self, mut item: T) -> Option<T> {
435444
if !self.is_empty() {
436445
swap(&mut item, &mut self.data[0]);
@@ -448,7 +457,7 @@ impl<T: Ord> BinaryHeap<T> {
448457
/// # Examples
449458
///
450459
/// ```
451-
/// #![feature(collections)]
460+
/// #![feature(binary_heap_extras)]
452461
///
453462
/// use std::collections::BinaryHeap;
454463
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4, 5, 6, 7]);
@@ -459,6 +468,9 @@ impl<T: Ord> BinaryHeap<T> {
459468
/// println!("{}", x);
460469
/// }
461470
/// ```
471+
#[unstable(feature = "binary_heap_extras",
472+
reason = "needs to be audited",
473+
issue = "28147")]
462474
pub fn into_vec(self) -> Vec<T> { self.data }
463475

464476
/// Consumes the `BinaryHeap` and returns a vector in sorted
@@ -467,7 +479,7 @@ impl<T: Ord> BinaryHeap<T> {
467479
/// # Examples
468480
///
469481
/// ```
470-
/// #![feature(collections)]
482+
/// #![feature(binary_heap_extras)]
471483
///
472484
/// use std::collections::BinaryHeap;
473485
///
@@ -478,6 +490,9 @@ impl<T: Ord> BinaryHeap<T> {
478490
/// let vec = heap.into_sorted_vec();
479491
/// assert_eq!(vec, [1, 2, 3, 4, 5, 6, 7]);
480492
/// ```
493+
#[unstable(feature = "binary_heap_extras",
494+
reason = "needs to be audited",
495+
issue = "28147")]
481496
pub fn into_sorted_vec(mut self) -> Vec<T> {
482497
let mut end = self.len();
483498
while end > 1 {
@@ -730,7 +745,7 @@ impl<T: Ord> IntoIterator for BinaryHeap<T> {
730745
/// # Examples
731746
///
732747
/// ```
733-
/// #![feature(collections)]
748+
/// #![feature(binary_heap_extras)]
734749
///
735750
/// use std::collections::BinaryHeap;
736751
/// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);

src/libcollectionstest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![feature(ascii)]
1212
#![feature(append)]
13+
#![feature(binary_heap_extras)]
1314
#![feature(box_syntax)]
1415
#![feature(btree_range)]
1516
#![feature(collections)]

src/test/run-pass/binary-heap-panic-safe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(std_misc, collections, catch_panic, rand, sync_poison)]
11+
#![feature(std_misc, binary_heap_extras, catch_panic, rand, sync_poison)]
1212

1313
use std::__rand::{thread_rng, Rng};
1414
use std::thread;

src/test/run-pass/while-let.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111

12-
#![feature(collections)]
12+
#![feature(binary_heap_extras)]
1313

1414
use std::collections::BinaryHeap;
1515

0 commit comments

Comments
 (0)