about summary refs log tree commit diff
path: root/src/libstd/collections
AgeCommit message (Collapse)AuthorLines
2018-05-01Rollup merge of #50316 - ehuss:fix-doc-links, r=frewsxcvkennytm-1/+1
Fix some broken links in docs.
2018-04-29Fix some broken links in docs.Eric Huss-1/+1
2018-04-28std: Inline `DefaultResizePolicy::new`Alex Crichton-0/+1
This should allow us to tighten up the [codegen][example] a bit more, avoiding a function call across object boundaries in the default optimized case. [example]: https://play.rust-lang.org/?gist=c1179088b0f8a4dcd93a9906463f993d&version=stable&mode=release
2018-04-22Replace GlobalAlloc::oom with a lang itemSteven Fackler-5/+5
2018-04-20Auto merge of #50088 - alexcrichton:std-tweaks, r=sfacklerbors-2/+2
Tweak some stabilizations in libstd This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in #49381, issue at #49657). The `and_modify` APIs added in #44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes #49581 Closes #49657
2018-04-19Tweak some stabilizations in libstdAlex Crichton-2/+2
This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in #49381, issue at #49657). The `and_modify` APIs added in #44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes #49581 Closes #49657
2018-04-17stabilize `hash_map_remove_entry` featuretinaun-2/+1
2018-04-16Auto merge of #48945 - clarcharr:iter_exhaust, r=Kimundibors-1/+1
Replace manual iterator exhaust with for_each(drop) This originally added a dedicated method, `Iterator::exhaust`, and has since been replaced with `for_each(drop)`, which is more idiomatic. <del>This is just shorthand for `for _ in &mut self {}` or `while let Some(_) = self.next() {}`. This states the intent a lot more clearly than the identical code: run the iterator to completion. <del>At least personally, my eyes tend to gloss over `for _ in &mut self {}` without fully paying attention to what it does; having a `Drop` implementation akin to: <del>`for _ in &mut self {}; unsafe { free(self.ptr); }`</del> <del>Is not as clear as: <del>`self.exhaust(); unsafe { free(self.ptr); }` <del>Additionally, I've seen debate over whether `while let Some(_) = self.next() {}` or `for _ in &mut self {}` is more clear, whereas `self.exhaust()` is clearer than both.
2018-04-12Rename alloc::Void to alloc::OpaqueSimon Sapin-1/+1
2018-04-12Use NonNull<Void> instead of *mut u8 in the Alloc traitMike Hommey-4/+2
Fixes #49608
2018-04-12Return Result instead of Option in alloc::Layout constructorsSimon Sapin-1/+1
2018-04-12Remove the now-unit-struct AllocErr field inside CollectionAllocErrSimon Sapin-4/+4
2018-04-12Remove the now-unit-struct AllocErr parameter of oom()Simon Sapin-3/+3
2018-04-12Actually deprecate the Heap typeSimon Sapin-8/+8
2018-04-12Import the `alloc` crate as `alloc_crate` in stdSimon Sapin-12/+7
… to make the name `alloc` available.
2018-04-04Replace manual iter exhaust with for_each(drop).Clar Charr-1/+1
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-176/+1
Closes #22181, #27779
2018-04-02Use Alloc and Layout from core::heap.Mike Hommey-2/+4
94d1970bba87f2d2893f6e934e4c3f02ed50604d moved the alloc::allocator module to core::heap, moving e.g. Alloc and Layout out of the alloc crate. While alloc::heap reexports them, it's better to use them from where they really come from.
2018-03-29Hide the Bound type in docs at its deprecated location in std::collectionsSimon Sapin-0/+1
2018-03-29Hide the deprecated std::collections::range module from docsSimon Sapin-0/+1
2018-03-29Move RangeArguments to {core::std}::ops and rename to RangeBoundsSimon Sapin-2/+6
These unstable items are deprecated: * The `std::collections::range::RangeArgument` reexport * The `std::collections::range` module.
2018-03-29Move alloc::Bound to {core,std}::opsSimon Sapin-1/+2
The stable reexport `std::collections::Bound` is now deprecated. Another deprecated reexport could be added in `alloc`, but that crate is unstable.
2018-03-28Rollup merge of #49400 - Diggsey:shrink-to, r=joshtriplettkennytm-0/+68
Implement `shrink_to` method on collections Fixes #49385
2018-03-27Implement `shrink_to` method on collectionsDiggory Blake-0/+68
2018-03-25Implement get_key_value for HashMap, BTreeMapDiggory Blake-0/+28
2018-03-15setting ABORTING_MALLOC for asmjs backendsnf-4/+0
2018-03-14try_reserve: disabling tests for asmjs, blocked by #48968snf-0/+4
2018-03-14implementing fallible allocation API (try_reserve) for Vec, String and HashMapsnf-29/+127
2018-03-06Rollup merge of #47463 - bluss:fused-iterator, r=alexcrichtonkennytm-14/+14
Stabilize FusedIterator FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate. Closes #35602
2018-03-05Remove a couple of `isize` references from hashmap docsTobias Bucher-29/+29
Also fix a spelling mistake.
2018-03-03core: Update stability attributes for FusedIteratorUlrik Sverdrup-14/+14
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-14/+14
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-02-25Rollup merge of #48166 - ↵kennytm-2/+1
hedgehog1024:hedgehog1024-stabilize-entry_and_modify, r=alexcrichton Stabilize 'entry_and_modify' feature Stabilize `entry_and_modify` feature introduced by #44734. Closes #44733
2018-02-251.25.0 -> 1.26.-Manish Goregaokar-1/+1
2018-02-1338880 remove unnecessary self.table.size checkShaun Steenkamp-4/+0
2018-02-1338880 fix incorrect negationShaun Steenkamp-1/+1
2018-02-1338880 hashmap check size=0, not just capacity=0Shaun Steenkamp-30/+24
2018-02-1338880 restore original entry(key) methodShaun Steenkamp-1/+3
2018-02-12Stabilize 'entry_and_modify' feature for HashMaphedgehog1024-2/+1
2018-02-1238880 fixup add missing mutShaun Steenkamp-1/+1
2018-02-1238880 remove redundant extra functionShaun Steenkamp-14/+6
2018-02-0638880 use search_mut function rather than search_hashedShaun Steenkamp-3/+1
2018-02-0638880 don't compute hash when searching an empty HashMapShaun Steenkamp-5/+35
This addresses issue #38880
2018-01-28Document that `Index` ops can panic on `HashMap` & `BTreeMap`.Corey Farwell-2/+7
Fixes https://github.com/rust-lang/rust/issues/47011.
2018-01-24Auto merge of #47299 - cramertj:unsafe-placer, r=alexcrichtonbors-1/+1
Make core::ops::Place an unsafe trait Consumers of `Place` would reasonably expect that the `pointer` function returns a valid pointer to memory that can actually be written to.
2018-01-20Rollup merge of #47578 - arthurprs:btree-doc, r=alexcrichtonGuillaume Gomez-2/+2
Update BTreeMap recommendation Focus on the ordering / range(instead of all) benefit as it's the most important feature.
2018-01-20Rename std::ptr::Shared to NonNullSimon Sapin-3/+3
`Shared` is now a deprecated `type` alias. CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
2018-01-19Update BTreeMap recommendationArthur Silva-2/+2
Focus on the ordering/range benefit.
2018-01-09Make core::ops::Place an unsafe traitTaylor Cramer-1/+1
2018-01-07Add HashMap::remove_entrySteven Fackler-1/+49
Implements #46344