summary refs log tree commit diff
path: root/src/libstd/collections
AgeCommit message (Collapse)AuthorLines
2019-11-01Rollup merge of #65112 - jack-t:type-parens-lint, r=varkorTyler Mandry-3/+3
Add lint and tests for unnecessary parens around types This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way. The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` — I'm not totally sure it worked right, though — and I've tried to follow the instructions linked in the readme. I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something. There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
2019-10-29Add lint for unnecessary parens around typesjack-t-3/+3
2019-10-11Rollup merge of #65048 - Kixunil:patch-1, r=KodrAusTyler Mandry-0/+2
Added doc about behavior of extend on HashMap It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.
2019-10-09Implement (HashMap) Entry::insert as per #60142Félix Saparelli-0/+47
2019-10-03Added doc about behavior of extend on HashMapMartin Habovštiak-0/+2
It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.
2019-10-01Remove unneeded `fn main` blocks from docsLzu Tao-13/+6
2019-09-27Stabilize map_get_key_value featureLzu Tao-2/+1
2019-08-16Add the Layout of the failed allocation to TryReserveError::AllocErrorSimon Sapin-2/+5
… and add a separately-unstable field to force non-exhaustive matching (`#[non_exhaustive]` is no implemented yet on enum variants) so that we have the option to later expose the allocator’s error value. CC https://github.com/rust-lang/wg-allocators/issues/23
2019-08-16Update hashbrown to 0.5.0Simon Sapin-1/+1
2019-08-16Rename CollectionAllocError to TryReserveErrorSimon Sapin-9/+9
2019-07-16Test that maplike FromIter satisfies uniquenessNick Hynes-2/+6
2019-07-02HashMap is UnwindSafeSimon Sapin-0/+6
Fixes https://github.com/rust-lang/rust/issues/62301, a regression in 1.36.0 which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
2019-05-20Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPCMazdak Farrokhzad-1/+4
Fix intra-doc link resolution failure on re-exporting libstd Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366). ```rust pub use std::*; ``` Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates. Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.) r? @QuietMisdreavus
2019-05-17Auto merge of #60899 - cuviper:RawEntryMut-origin-story, r=Centrilbors-2/+4
doc: correct the origin of RawEntryMut
2019-05-16doc: correct the origin of RawEntryMutJosh Stone-2/+4
2019-05-16Comment why get_or_insert returns &TJosh Stone-0/+4
2019-05-16Add a hash_set_entry tracking issueJosh Stone-2/+2
2019-05-16Add entry-like methods to HashSetJosh Stone-0/+52
* `HashSet::get_or_insert` * `HashSet::get_or_insert_with` These provide a simplification of the `Entry` API for `HashSet`, with names chosen to match the similar methods on `Option`.
2019-05-04Fix intra-doc link resolution failure on re-exporting libstdTaiki Endo-1/+4
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+2
2019-04-24Remove broken testsAmanieu d'Antras-74/+0
2019-04-24Replace the robin-hood hash table with hashbrownAmanieu d'Antras-2278/+405
2019-04-24Mark HashSet functions with #[inline]Amanieu d'Antras-0/+45
2019-04-24Add try_reserve to HashSetAmanieu d'Antras-0/+24
2019-04-24Remove the Recover trait for HashSetAmanieu d'Antras-52/+9
2019-04-15Remove collection-specific `with_capacity` doc from `std::collections`Marc-4/+3
Fixes #59931
2019-04-03improve worst-case performance of HashSet.is_subsetStein Somers-1/+5
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-44/+44
2019-03-16Rollup merge of #59082 - alexreg:cosmetic-2-doc-comments, r=Centrilkennytm-2/+2
A few improvements to comments in user-facing crates Not too many this time, and all concern comments (almost all doc comments) in user-facing crates (libstd, libcore, liballoc). r? @steveklabnik
2019-03-11Improvements to comments in libstd, libcore, liballoc.Alexander Regueiro-2/+2
2019-03-09Use lifetime contravariance to elide more lifetimes in core+alloc+stdScott McMurray-4/+4
2019-03-08Rollup merge of #58369 - nox:sync-hash-map-entry, r=AmanieuPietro Albini-0/+10
Make the Entry API of HashMap<K, V> Sync and Send Fixes #45219
2019-03-04Make the Entry API of HashMap<K, V> Sync and Send (fixes #45219)Anthony Ramine-0/+10
2019-02-28libstd => 2018Taiki Endo-31/+28
2019-02-25Rollup merge of #58370 - nox:relax-bounds, r=dtolnayMazdak Farrokhzad-354/+343
Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S> Notably, hash iterators don't require any trait bounds to be iterated.
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-73/+73
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-17Use more impl header lifetime elisionScott McMurray-73/+73
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-13Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S>Anthony Ramine-354/+343
Notably, hash iterators don't require any trait bounds to be iterated.
2019-02-10libs: doc commentsAlexander Regueiro-17/+17
2019-01-09Fix poor worst case performance of is_disjointStein Somers-2/+5
2019-01-09Merge remote-tracking branch 'upstream/master'Stein Somers-62/+8
2019-01-03Fix repeated word typosWiktor Kuchta-1/+1
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2018-12-28Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centrilbors-0/+3
Add example of using the indexing operator to HashMap docs Fixes #52575
2018-12-25Remove licensesMark Rousskov-60/+0
2018-12-23Rollup merge of #57050 - RyanMarcus:master, r=zackmdaviskennytm-1/+1
Fixed typo in HashMap documentation Previously "with a custom type as key", now "with a custom key type"
2018-12-21Fixed typo in HashMap documentationRyan Marcus-1/+1
Previously "with a custom type as key", now "with a custom key type"
2018-12-21Fix poor worst case performance of set intersection (and union, somewhat) on ↵Stein Somers-6/+56
asymmetrically sized sets and extend unit tests slightly beyond that
2018-12-21Inline tweaksJohn Kåre Alsaker-0/+3
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-6/+6
2018-12-07Rollup merge of #56561 - Zoxc:too-raw, r=Gankrokennytm-0/+4
Fix bug in from_key_hashed_nocheck