rust/library/std/src
Tyler Mandry fa56cf537f
Rollup merge of #76458 - mbrubeck:hash_drain_filter, r=Amanieu
Add drain_filter method to HashMap and HashSet

Add `HashMap::drain_filter` and `HashSet::drain_filter`, implementing part of rust-lang/rfcs#2140.  These new methods are unstable.  The tracking issue is #59618.

The added iterators behave the same as `BTreeMap::drain_filter` and `BTreeSet::drain_filter`, except their iteration order is arbitrary.  The unit tests are adapted from `alloc::collections::btree`.

This branch rewrites `HashSet` to be a wrapper around `hashbrown::HashSet` rather than `std::collections::HashMap`.
 (Both are themselves wrappers around `hashbrown::HashMap`, so the in-memory representation is the same either way.)  This lets `std` re-use more iterator code from `hashbrown`.  Without this change, we would need to duplicate much more code to implement `HashSet::drain_filter`.

This branch also updates the `hashbrown` crate to version 0.9.0.  Aside from changes related to the `DrainFilter` iterators, this version only changes features that are not used in libstd or rustc.  And it updates `indexmap` to version 1.6.0, whose only change is compatibility with `hashbrown` 0.9.0.
2020-09-09 21:02:27 -07:00
..
backtrace std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
collections Tests for HashMap/HashSet::drain_filter 2020-09-08 17:24:28 -07:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f64 std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
ffi Capitalize safety comments 2020-09-08 22:26:44 -04:00
fs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
io Auto merge of #74366 - t-rapp:tr-bufreader-pos, r=LukasKalbertodt 2020-09-07 11:09:41 +00:00
lazy std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
memchr std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
net Make Ipv4Addr and Ipv6Addr const tests unit tests under library 2020-09-03 23:17:21 +02:00
num std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
os Remove a useless allowed attr 2020-09-04 02:42:50 +00:00
path std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
prelude Fix incorrect link in prelude 2020-09-02 17:38:21 -04:00
process std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
sync Auto merge of #76128 - poliorcetics:doc-use-arc-clone, r=KodrAus 2020-09-06 12:34:31 +00:00
sys Capitalize safety comments 2020-09-08 22:26:44 -04:00
sys_common Capitalize safety comments 2020-09-08 22:26:44 -04:00
thread std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
time std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
alloc.rs Capitalize safety comments 2020-09-08 22:26:44 -04:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
env.rs Improve docs for std::env::args() 2020-09-04 14:00:09 -07:00
error.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f64.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
fs.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
future.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
keyword_docs.rs Improve wording for const pointers 2020-09-01 19:44:20 -07:00
lazy.rs Capitalize safety comments 2020-09-08 22:26:44 -04:00
lib.rs Rollup merge of #76142 - CDirkx:const-ip, r=ecstatic-morse 2020-09-03 02:22:02 +02:00
macros.rs Add missing links 2020-08-22 20:23:50 -07:00
memchr.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
num.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
panic.rs Abort when catch_unwind catches a foreign exception 2020-08-27 21:08:30 +01:00
panicking.rs Abort when catch_unwind catches a foreign exception 2020-08-27 21:08:30 +01:00
path.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
primitive_docs.rs Rollup merge of #76164 - lzutao:slice-array, r=ehuss 2020-09-03 02:22:04 +02:00
process.rs std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
rt.rs Prevent __rust_begin_short_backtrace frames from being tail-call optimised away 2020-08-07 19:31:25 +01:00
time.rs Rollup merge of #76162 - abrausch:documentation-fix-duration_since, r=jyn514 2020-09-09 01:35:10 +02:00