Skip to content

Tracking issue for BinaryHeap::{push_pop, replace} #28147

Closed
@eefriedman

Description

@eefriedman
Contributor

Updated issue

Tracking issue for

  • BinaryHeap::push_pop
  • BinaryHeap::replace

Original Report

std::collections::BinaryHeap has a bunch of unstable methods without proper stability markings; filing an issue to point them at. Someone please label this B-unstable.

Activity

added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
B-unstableBlocker: Implemented in the nightly compiler and unstable.
on Sep 1, 2015
BurntSushi

BurntSushi commented on Sep 16, 2015

@BurntSushi
Member

It looks like the unstable methods are: from_vec, push_pop, replace, into_vec, into_sorted_vec and drain. Except for drain, is there any writing on why these methods were not stabilized? Were there any specific reservations about those methods?

alexcrichton

alexcrichton commented on Sep 17, 2015

@alexcrichton
Member

I believe they weren't stabilized mostly because they didn't fit into any existing collections conventions and to be conservative we didn't add too much special functionality to collections around 1.0. They're pretty innocuous though, so I'd imagine they're ripe for some small modernization followed by stabilization.

sfackler

sfackler commented on Sep 17, 2015

@sfackler
Member

from_vec and into_vec seem like super obvious and straightforward methods to stabilize as is.

push_pop and replace seems a bit weirder. What use cases are they targeting? What kind of performance improvements do you actually see using them vs replicating their behavior naively? C++ and Java don't have any equivalent functionality.

aturon

aturon commented on Sep 23, 2015

@aturon
Member

Should replace from_vec with an impl of the From trait.

sfackler

sfackler commented on Sep 23, 2015

@sfackler
Member

We should be careful to document the impl so that people can ctrl+f heapify and find it.

alexcrichton

alexcrichton commented on Sep 24, 2015

@alexcrichton
Member

This issue is now entering its cycle-long FCP for stabilization in 1.5

The specific actions to be taken here will be:

  • Deprecate from_vec in favor of From<Vec<T>> for BinaryHeap<T>
  • Stabilize into_vec as well as add Into<Vec<T>> for BinaryHeap<T>
  • Stabilize intoto_sorted_vec

The push_pop and replace methods will have an FCP at a later time.

added
final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
and removed on Sep 24, 2015
BurntSushi

BurntSushi commented on Sep 24, 2015

@BurntSushi
Member

I think we want From<BinaryHeap<T>> for Vec<T> instead? (I think this gives us the Into impl automatically.)

added this to the 1.5 milestone on Oct 1, 2015
photino

photino commented on Oct 21, 2015

@photino

If we have already stabilized the into_vec method, are there any good reasons for adding Into<Vec<T>> for BinaryHeap<T> with the same functionality?

sfackler

sfackler commented on Oct 21, 2015

@sfackler
Member

Into<Vec<T>> can be used in generic contexts.

43 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-unstableBlocker: Implemented in the nightly compiler and unstable.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@alexcrichton@BurntSushi@aturon@sfackler

        Issue actions

          Tracking issue for BinaryHeap::{push_pop, replace} · Issue #28147 · rust-lang/rust