summary refs log tree commit diff
path: root/src/libcollections/binary_heap.rs
AgeCommit message (Collapse)AuthorLines
2015-09-02Auto merge of #28156 - nagisa:binaryheap-debug, r=Gankrobors-0/+8
r? @Gankro
2015-09-01Implement Debug for BinaryHeapSimonas Kazlauskas-0/+8
Fixes #28154
2015-09-01Add missing stability markings to BinaryHeap.Eli Friedman-8/+23
2015-08-18Fixed example in documentationjotomicron-1/+1
Added the cost of the edge 3 -> 4 on the example in the module documentation
2015-08-15collections: Add issues for unstable featuresAlex Crichton-2/+3
2015-08-11Register new snapshotsAlex Crichton-3/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-03syntax: Implement #![no_core]Alex Crichton-1/+2
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-27Show appropriate feature flags in docsSteve Klabnik-8/+16
2015-06-17collections: Split the `collections` featureAlex Crichton-7/+9
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-2/+2
2015-06-08Implement RFC 839Johannes Oertel-0/+7
Closes #25976.
2015-05-28collections: Make BinaryHeap panic safe in sift_up / sift_downUlrik Sverdrup-25/+88
Use a struct called Hole that keeps track of an invalid location in the vector and fills the hole on drop. I include a run-pass test that the current BinaryHeap fails, and the new one passes. Fixes #25842
2015-04-28collections: Implement vec::drain(range) according to RFC 574Ulrik Sverdrup-1/+1
Old `.drain()` on vec is performed using `.drain(..)` now. `.drain(range)` is unstable and under feature(collections_drain) [breaking-change]
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-25/+19
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-1/+1
2015-03-25Rollup merge of #23617 - steveklabnik:gh23564, r=ManishearthManish Goregaokar-0/+2
Fixes #23564
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+8
2015-03-22Note order of BinaryHeap::drainSteve Klabnik-0/+2
Fixes #23564
2015-03-16extract libcollections tests into libcollectionstestJorge Aparicio-215/+0
2015-03-16document undefined collection behavior with interior mutabilityAndrew Paseltiner-0/+5
closes #23327
2015-03-03Add `: Box<_>` or `::Box<_>` type annotations to various places.Felix S. Klock II-1/+1
This is the kind of change that one is expected to need to make to accommodate overloaded-`box`. ---- Note that this is not *all* of the changes necessary to accommodate Issue 22181. It is merely the subset of those cases where there was already a let-binding in place that made it easy to add the necesasry type ascription. (For unnamed intermediate `Box` values, one must go down a different route; `Box::new` is the option that maximizes portability, but has potential inefficiency depending on whether the call is inlined.) ---- There is one place worth note, `run-pass/coerce-match.rs`, where I used an ugly form of `Box<_>` type ascription where I would have preferred to use `Box::new` to accommodate overloaded-`box`. I deliberately did not use `Box::new` here, because that is already done in coerce-match-calls.rs. ---- Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-1/+1
2015-02-18make FromIterator use IntoIteratorAlexis-2/+2
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18make Extend use IntoIteratorAlexis-1/+2
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-17Register new snapshotsAlex Crichton-22/+0
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+2
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17Rollup merge of #22313 - japaric:iter, r=aturonManish Goregaokar-0/+24
`IntoIterator` now has an extra associated item: ``` rust trait IntoIterator { type Item; type IntoIter: Iterator<Self=Self::Item>; } ``` This lets you bind the iterator \"`Item`\" directly when writing generic functions: ``` rust // hypothetical change, not included in this PR impl Extend<T> for Vec<T> { // you can now write fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. } // instead of fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. } } ``` The downside is that now you have to write an extra associated type in your `IntoIterator` implementations: ``` diff impl<T> IntoIterator for Vec<T> { + type Item = T; type IntoIter = IntoIter<T>; fn into_iter(self) -> IntoIter<T> { .. } } ``` Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change] --- r? @aturon
2015-02-13add an associated `Item` type to `IntoIterator`Jorge Aparicio-0/+24
2015-02-13more int and cloned cleanup in collectionsAlexis-1/+1
2015-02-09std: Rename IntoIterator::Iter to IntoIterAlex Crichton-2/+2
This is in preparation for stabilization of the `IntoIterator` trait. All implementations and references to `Iter` need to be renamed to `IntoIter`. [breaking-change]
2015-02-07fix outdated docsAlexis-5/+5
Conflicts: src/libstd/collections/mod.rs
2015-02-05remove unecessary lifetimes from a bunch of collections codeAlexis-1/+1
2015-02-05misc collections code cleanupAlexis-61/+60
2015-02-02remove unused mut qualifiersJorge Aparicio-1/+1
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-2/+2
2015-01-30rollup merge of #21631: tbu-/isize_policeAlex Crichton-38/+38
Conflicts: src/libcoretest/iter.rs
2015-01-30fix recursive callJorge Aparicio-1/+1
2015-01-30core: add the `IntoIterator` traitJorge Aparicio-1/+17
2015-01-30Remove all `i` suffixesTobias Bucher-38/+38
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-1/+1
2015-01-23grandfathered -> rust1Brian Anderson-31/+31
2015-01-23Set unstable feature names appropriatelyBrian Anderson-2/+2
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-2/+2
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-33/+34
2015-01-05Revert "Remove i suffix in docs"Alex Crichton-11/+11
This reverts commit f031671c6ea79391eeb3e1ad8f06fe0e436103fb. Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
2015-01-05rollup merge of #20560: aturon/stab-2-iter-ops-sliceAlex Crichton-0/+5
Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
2015-01-05Remove i suffix in docsSteve Klabnik-11/+11
2015-01-05Stabilization of impls and fallout from stabilizationAaron Turon-0/+4
2015-01-05Stabilize collection modulesAaron Turon-0/+1
The earlier collections stabilization did not cover the modules themselves. This commit marks as stable those modules whose types have been stabilized.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-3/+3