about summary refs log tree commit diff
path: root/src/libstd/collections
AgeCommit message (Collapse)AuthorLines
2017-08-01Show that the capacity changed in HashSet::reserve doc example.Corey Farwell-0/+1
2017-08-01Add doc example for HashSet::hasher.Corey Farwell-0/+11
2017-08-01Fixed extra cases found in better checking.Isaac van Bakel-1/+1
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-1/+1
2017-07-26Rollup merge of #42959 - SimonSapin:nonzero-checked, r=sfacklerMark Simulacrum-3/+3
Make the "main" constructors of NonZero/Shared/Unique return Option Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441. This is a breaking change to unstable APIs. The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts. In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.
2017-07-23Fix some doc/comment typos.Bruce Mitchener-1/+1
2017-07-22Add conversions from references to NonZero pointers, Unique, and SharedSimon Sapin-1/+1
2017-07-22Rename {NonZero,Shared,Unique}::new to new_uncheckedSimon Sapin-3/+3
2017-07-06Add annotations to the resize fn #39791Ryan Thomas-0/+2
This adds the `inline(never)` and `cold` annotations to the HashMap::resize function.
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-6/+5
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-2/+0
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-24Stabilize RangeArgumentSteven Fackler-0/+2
Move it and Bound to core::ops while we're at it. Closes #30877
2017-06-23Relax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.Federico Ravasio-2/+2
Fixed #41924.
2017-06-21Impl Clone for DefaultHasherLeonardo Yvens-1/+1
2017-06-13Merge crate `collections` into `alloc`Murarth-6/+6
2017-05-21Auto merge of #41904 - sfackler:1.18-stabilization, r=alexcrichtonbors-34/+22
Stabilize library features for 1.18.0 Closes #38863 Closes #38980 Closes #38903 Closes #36648 r? @alexcrichton @rust-lang/libs
2017-05-20Stabilize library features for 1.18.0Steven Fackler-34/+22
Closes #38863 Closes #38980 Closes #38903 Closes #36648
2017-05-20migrate everything to using mem::needs_dropAlexis Beingessner-2/+1
2017-05-04Deprecate heap::EMPTY in favour of Unique::empty or otherwise.Alexis Beingessner-1/+2
2017-05-04fallout from NonZero/Unique/Shared changesAlexis Beingessner-9/+12
2017-04-23Auto merge of #41437 - cuviper:remove-unstable-deprecated, r=alexcrichtonbors-7/+0
Remove items that are unstable and deprecated This removes unstable items that have been deprecated for more than one cycle. - Since 1.16.0, `#![feature(enumset)]` - All of `mod collections::enum_set` - Since 1.15.0, `#![feature(borrow_state)]` - `cell::BorrowState` - `RefCell::borrow_state()` - Since 1.15.0, `#![feature(is_unique)]` - `Rc::is_unique()` (made private like `Arc::is_unique()`) - Since 1.15.0, `#![feature(rc_would_unwrap)]` - `Rc::would_wrap()` - Since 1.13.0, `#![feature(binary_heap_extras)]` - `BinaryHeap::push_pop()` - `BinaryHeap::replace()` - Since 1.12.0, `#![feature(as_unsafe_cell)]` - `Cell::as_unsafe_cell()` - `RefCell::as_unsafe_cell()` - Since 1.12.0, `#![feature(map_entry_recover_keys)]` - `btree_map::OccupiedEntry::remove_pair()` - `hash_map::OccupiedEntry::remove_pair()` - Since 1.11.0, `#![feature(float_extras)]` - `Float::nan()` - `Float::infinity()` - `Float::neg_infinity()` - `Float::neg_zero()` - `Float::zero()` - `Float::one()` - `Float::integer_decode()` - `f32::integer_decode()` - `f32::ldexp()` - `f32::frexp()` - `f32::next_after()` - `f64::integer_decode()` - `f64::ldexp()` - `f64::frexp()` - `f64::next_after()` - Since 1.11.0, `#![feature(zero_one)]` - `num::Zero` - `num::One`
2017-04-22Fix invalid linkageGuillaume Gomez-2/+2
2017-04-20Remove OccupiedEntry::remove_pairJosh Stone-7/+0
[unstable, deprecated since 1.12.0]
2017-04-13Various consistency and phrasing fixes in std::collections' docslukaramu-14/+11
* Changed btree_map's and hash_map's Entry (etc.) docs to be consistent * Changed VecDeque's type and module summary sentences to be consistent with each other as well as with other summary sentences in the module * Changed HashMap's and HashSet's summary sentences to be less redundantly phrased and also more consistant with the other summary sentences in the module * Also, added an example to Bound
2017-04-13Various fixes throughout std::collections' docslukaramu-66/+88
* Added links where possible (limited because of facading) * Changed references to methods from `foo()` to `foo` in module docs * Changed references to methods from `HashMap::foo` to just `foo` in top-level docs for `HashMap` and the `default` doc for `DefaultHasher` * Various small other fixes
2017-04-13Update std::collections' docs to use iterator (etc.) boilerplatelukaramu-14/+98
This greatly improves consistency.
2017-04-04Simplify HashMap Bucket interfacearthurprs-191/+165
* Store capacity_mask instead of capacity * Move bucket index into RawBucket * Bucket index is now always within [0..table_capacity) * Clone RawTable using RawBucket * Simplify iterators by moving logic into RawBuckets * Make retain aware of the number of elements
2017-03-22Simplify hash table dropsJosh Stone-47/+18
This replaces the `std::collections::hash::table::RevMoveBuckets` iterator with a simpler `while` loop. This iterator was only used for dropping the remaining elements of a `RawTable`, so instead we can just loop through directly and drop them in place. This should be functionally equivalent to the former code, but a little easier to read. I was hoping it might have some performance benefit too, but it seems the optimizer was already good enough to see through the iterator -- the generated code is nearly the same. Maybe it will still help if an element type has more complicated drop code.
2017-03-19Rollup merge of #40621 - jswalden:dependant-spelling-fix, r=sfacklerCorey Farwell-2/+2
Fix a spelling error in HashMap documentation, and slightly reword surrounding text for precision Noticed while reading docs just now. It's possible that the prior wording *meant* to state that the seed's randomness depends on the exact instant that the system RNG was created, I guess. But unless there's an API guarantee that this is the case, the wording seems over-precise. Is there a formal API guarantee that would forbid, say, the system RNG from generating all output using the Intel RDRAND instruction? I don't think the quality of output in that case would depend on when the RNG was created. Yet it seems to me like it could well be a valid source of randomness when computing the initial seed. For that reason, tying the randomness of the seed, to the quality of the RNG's output *at the precise instant the seed is computed*, seems less confining. That instantaneous quality level could be determined by the quality at the instant the RNG was created -- but instantaneous quality need not be low for that precise reason.
2017-03-17Fix a spelling error in HashMap documentation, and slightly reword it to be ↵Jeff Walden-2/+2
more precise.
2017-03-17Stabilize rc_raw feature, closes #37197Aaron Turon-1/+1
2017-03-11Implement placement-in protocol for `HashMap`Charlie Fan-5/+182
2017-03-03Reduce size overhead of adaptative hashmaparthurprs-24/+74
Exposes a boolean flag in RawTable and use it instead of a bool field in HashMap. Fixes: #40042
2017-02-20Simplify adaptive hashmaparthurprs-23/+11
2017-02-18Fix spelling in commentsarthurprs-5/+5
2017-02-16Resize hashmap when long probes are detectedarthurprs-12/+105
2017-02-15Rollup merge of #39839 - king6cong:refine-doc, r=frewsxcvCorey Farwell-1/+1
make doc consistent with var name
2017-02-15Auto merge of #39560 - F001:retainHashMap, r=alexcrichtonbors-46/+182
std: Add retain method for HashMap and HashSet Fix #36648 r? @bluss
2017-02-15make doc consistent with var nameking6cong-1/+1
2017-02-12Rollup merge of #39662 - Henning-K:patch-1, r=frewsxcvGuillaume Gomez-1/+1
Fixes #39661 Clarifies the potential ambiguity.
2017-02-09Update set operations documentationJethro Beekman-7/+13
Reminding people of set terminology.
2017-02-09Fix missing article.Henning Kowalk-1/+1
2017-02-09Fixed #39661Henning Kowalk-1/+1
Clarified potential ambiguity.
2017-02-08std: Add retain method for HashMap and HashSetf001-46/+182
Fix #36648
2017-02-05Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichtonCorey Farwell-15/+15
Fix a few impl stability attributes The versions show up in rustdoc.
2017-02-03Add missing urls in HashMapGuillaume Gomez-5/+12
2017-01-29Fix a few impl stability attributesOliver Middleton-15/+15
The versions show up in rustdoc.
2017-01-13Change `to_owned` to `to_string` in docsStjepan Glavina-2/+2
We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
2016-12-28Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]`Andrew Paseltiner-2/+1
CC #34761
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-2/+187
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.