Some improvements in collections#14279
Conversation
|
Thanks for doing this. While you're doing modifying #[deprecated="renamed to `into_vec`"]
fn to_vec(self) -> Vec<T> { self.into_vec() }
#[deprecated="renamed to `into_sorted_vec`"]
fn to_sorted_vec(self) -> Vec<T> { self.into_sorted_vec() }
fn into_vec(self) { /* current code in `.to_vec` */ }
fn into_sorted_vec(self) { /* current code in `.to_sorted_vec` */ }Also, the |
src/libcollections/priority_queue.rs
Outdated
There was a problem hiding this comment.
This isn't actually necessary: it is essentially free (no allocation) to create an empty priority queue, and .extend (below) reserves space itself.
|
I will add that. Also, I think we should get rid of |
|
Yep, sounds good. |
|
I think it is ready! I have done what you said and also added TotalOrd to DList::insert_ordered @huonw r? |
|
The commits that deprecate or change signatures need to have the Or, alternatively, it's OK if you edited the PR description to include a summary of all the changes, and put the |
|
@huonw Done! |
The breaking changes are: * Changed `DList::insert_ordered` to use `TotalOrd`, not `Ord` * Changed `PriorityQueue` to use `TotalOrd`, not `Ord` * Deprecated `PriorityQueue::maybe_top()` (renamed to replace `PriorityQueue::top()`) * Deprecated `PriorityQueue::maybe_pop()` (renamed to replace `PriorityQueue::pop()`) * Deprecated `PriorityQueue::to_vec()` (renamed to `PriorityQueue::into_vec()`) * Deprecated `PriorityQueue::to_sorted_vec()` (renamed to `PriorityQueue::into_sorted_vec()`) * Changed `PriorityQueue::replace(...)` to return an `Option<T>` instead of failing when the queue is empty. [breaking-change]
…albasi fix: ignore impls with `#[rustc_reservation_impl]` Fixes rust-lang#12247 Fixes rust-lang#14279 Currently core has two blanket impls for `From`: `impl<T> From<T> for T` and `impl<T> From<!> for T`. These are conflicting and thus chalk cannot uniquely solve `S: From<?0>` for any type `S`. The latter impl is actually a reservation impl and should not be considered during trait selection. More generally, impls attributed with perma-unstable `#[rustc_reservation_impl]` attribute should be disregarded except for coherence checks. See rust-lang#64631 and rust-lang#64715 for details. I chose to entirely ignore them in hir-ty because we don't do coherence checks.
…ang#14279) fixes rust-lang#14277 changelog: [`incompatible_msrv`]: add config option [`check-incompatible-msrv-in-tests`] to enable in `#[test]` and `#[cfg(test)]` code.
The breaking changes are:
DList::insert_orderedto useTotalOrd, notOrdPriorityQueueto useTotalOrd, notOrdPriorityQueue::maybe_top()(renamed to replacePriorityQueue::top())PriorityQueue::maybe_pop()(renamed to replacePriorityQueue::pop())PriorityQueue::to_vec()(renamed toPriorityQueue::into_vec())PriorityQueue::to_sorted_vec()(renamed toPriorityQueue::into_sorted_vec())PriorityQueue::replace(...)to return anOption<T>instead of failing when the queue is empty.[breaking-change]