about summary refs log tree commit diff
path: root/src/libstd/collections
AgeCommit message (Collapse)AuthorLines
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-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
2018-12-06Fix bug in from_key_hashed_nocheckJohn Kåre Alsaker-0/+4
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-2/+2
2018-12-02Update issue number of `shrink_to` methods to point the tracking issueHidehito Yabuuchi-2/+2
2018-11-30Inline thingsJohn Kåre Alsaker-0/+11
2018-11-22Fix the tracking issue for hash_raw_entrySteven Fackler-38/+38
It used to point to the implementation PR.
2018-11-22Rollup merge of #55784 - meltinglava:master, r=KodrAusGuillaume Gomez-8/+8
Clarifying documentation for collections::hash_map::Entry::or_insert Previous version does not show that or_insert does not insert the passed value, as the passed value was the same value as what was already in the map.
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-13The example values are now easyer to differenciateMeltinglava-8/+8
2018-11-08Clarifying documentation for collections::hash_map::Entry::or_insertMeltinglava-2/+2
Previous version does not show that or_insert does not insert the passed value, as the passed value was the same value as what was already in the map.
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-11-02Auto merge of #54043 - fintelia:raw_entry, r=alexcrichtonbors-6/+672
Add raw_entry API to HashMap This is a continuation of #50821.
2018-10-31A couple suggested editsJonathan Behrens-7/+3
2018-10-30Add example of using the indexing operator to HashMap docsFlorian Hartwig-0/+3
2018-09-16Auto merge of #53804 - RalfJung:ptr-invalid, r=nagisabors-1/+3
fix some uses of pointer intrinsics with invalid pointers [Found by miri](https://github.com/solson/miri/pull/446): * `Vec::into_iter` calls `ptr::read` (and the underlying `copy_nonoverlapping`) with an unaligned pointer to a ZST. [According to LLVM devs](https://bugs.llvm.org/show_bug.cgi?id=38583), this is UB because it contradicts the metadata we are attaching to that pointer. * `HashMap` creation calls `ptr:.write_bytes` on a NULL pointer with a count of 0. This is likely not currently UB *currently*, but it violates the rules we are setting in https://github.com/rust-lang/rust/pull/53783, and we might want to exploit those rules later (e.g. with more `nonnull` attributes for LLVM). Probably what `HashMap` really should do is use `NonNull::dangling()` instead of 0 for the empty case, but that would require a more careful analysis of the code. It seems like ideally, we should do a review of usage of such intrinsics all over libstd to ensure that they use valid pointers even when the size is 0. Is it worth opening an issue for that?
2018-09-13Entry is an enum not a structJonathan Behrens-1/+1
2018-09-13Fix links in docsJonathan Behrens-2/+7
2018-09-13Eliminate unused variable warningJonathan Behrens-1/+1
2018-09-13Fix tests and update issue numberJonathan Behrens-138/+156
2018-09-13Remove println!() statement from HashMap unit testJonathan Behrens-1/+0
2018-09-12Fix formattingJonathan Behrens-1/+2
2018-09-10fix typos in growth algo descriptionVal-4/+4
modified to read "the first table overflows into the second, and the second into the first." plus smaller typos
2018-09-07Cleanup API somewhatJonathan Behrens-217/+195
2018-09-06Fix invalid urlsGuillaume Gomez-3/+2
2018-09-05disambiguate hashesAlexis Beingessner-3/+3
2018-09-05fixup Debug boundsAlexis Beingessner-2/+2
2018-09-05progress on raw_entryAlexis Beingessner-229/+231
2018-09-05WIP: add raw_entry API to HashMapAlexis Beingessner-37/+703
2018-08-29fix some uses of pointer intrinsics with invalid pointersRalf Jung-1/+3
2018-08-20Replace usages of ptr::offset with ptr::{add,sub}.Corey Farwell-2/+2
2018-06-29Move core::alloc::CollectionAllocErr to alloc::collectionsSimon Sapin-3/+4
2018-06-29Move some alloc crate top-level items to a new alloc::collections moduleSimon Sapin-4/+4
This matches std::collections
2018-06-19Auto merge of #51543 - SimonSapin:oom, r=SimonSapinbors-2/+2
Rename OOM to allocation error The acronym is not descriptive unless one has seen it before. * Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle. * Rename `set_oom_hook` to `set_alloc_error_hook` * Rename `take_oom_hook` to `take_alloc_error_hook` Bikeshed: `on` v.s. `for`, `alloc` v.s. `allocator`, `error` v.s. `failure`
2018-06-18Rename OOM to allocation errorSimon Sapin-2/+2
The acronym is not descriptive unless one has seen it before. * Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle. * Rename `set_oom_hook` to `set_alloc_error_hook` * Rename `take_oom_hook` to `take_alloc_error_hook` Bikeshed: `alloc` v.s. `allocator`, `error` v.s. `failure`
2018-06-18Prefer use of owned values in examplesKornel-23/+37
2018-06-11Remove deprecated heap modulesSimon Sapin-1/+1
The heap.rs file was already unused.
2018-06-11Remove alloc::Opaque and use *mut u8 as pointer type for GlobalAllocMike Hommey-1/+1
2018-06-10Stabilize entry-or-defaultGuillaume Gomez-3/+1
2018-06-04Optimize layout calculations in HashMapAmanieu d'Antras-3/+16
This now produces the same assembly code as the previous implementation.
2018-06-02Add a couple lines describing differences between into_mut/get_mut.Corey Farwell-0/+9
2018-06-02Fixed typoPhlosioneer-1/+1
2018-06-02Clarify the difference between get_mut and into_mut for OccupiedEntryPhlosioneer-2/+6
The examples for both hash_map::OccupiedEntry::get_mut and hash_map::OccupiedEntry::into_mut were almost identical. This led to some confusion over the difference, namely why you would ever use get_mut when into_mut gives alonger lifetime. Reddit thread: https://www.reddit.com/r/rust/comments/8a5swr/why_does_hashmaps This commit adds two lines and a comment to the example, to show that the entry object can be re-used after calling get_mut.