summary refs log tree commit diff
path: root/library/alloc/src/collections/btree/map
AgeCommit message (Collapse)AuthorLines
2021-02-06Rollup merge of #81610 - ssomers:btree_emphasize_ord_bound, r=dtolnayMara Bos-0/+28
BTreeMap: make Ord bound explicit, compile-test its absence Most `BTreeMap` and `BTreeSet` members are subject to an `Ord` bound but a fair number of methods are not. To better convey and perhaps later tune the `Ord` bound, make it stand out in individual `where` clauses, instead of once far away at the beginning of an `impl` block. This PR does not introduce or remove any bounds. Also adds compilation test cases checking that the bound doesn't creep in unintended on the historically unbounded methods.
2021-02-04Revert "Avoid leaking block expression values"Felix S. Klock II-1/+1
This reverts commit 4fef39113a514bb270f5661a82fdba17d3e41dbb.
2021-02-02BTreeMap: make Ord bound explicit, compile-test its absenceStein Somers-0/+28
2021-01-19BTreeMap: compile-test all borrowing interfaces and test more chaotic orderStein Somers-1/+87
2020-12-28Rollup merge of #80353 - ssomers:btree_test_split_off, r=Mark-SimulacrumDylan DPC-1/+19
BTreeMap: test split_off (and append) more thoroughly Using DeterministicRng as a poor man's property based testing rig. r? ``@Mark-Simulacrum``
2020-12-26Auto merge of #80354 - ssomers:btree_test_compact, r=Mark-Simulacrumbors-8/+32
BTreeMap: test full nodes a little more r? `@Mark-Simulacrum`
2020-12-24BTreeMap: test full nodes a little moreStein Somers-8/+32
2020-12-24BTreeMap: test split_off (and append) more thoroughlyStein Somers-1/+19
2020-12-24BTreeMap: make test cases more explicit on failureStein Somers-1/+1
2020-12-19Rollup merge of #78083 - ChaiTRex:master, r=m-ou-seYuki Okushi-5/+7
Stabilize or_insert_with_key Stabilizes the `or_insert_with_key` feature from https://github.com/rust-lang/rust/issues/71024. This allows inserting key-derived values when a `HashMap`/`BTreeMap` entry is vacant. The difference between this and `.or_insert_with(|| ... )` is that this provides a reference to the key to the closure after it is moved with `.entry(key_being_moved)`, avoiding the need to copy or clone the key.
2020-12-07Removed spurious linebreak from new documentationChai T. Rex-1/+1
2020-12-07Improved documentation for HashMap/BTreeMap Entry's .or_insert_with_key methodChai T. Rex-3/+6
2020-12-04Avoid leaking block expression valuesMatthew Jasper-1/+1
2020-12-01Update rustc version that or_insert_with_key landedChai T. Rex-1/+1
2020-11-28BTreeMap: try to enhance various comments & local identifiersStein Somers-1/+1
2020-11-22Rollup merge of #79295 - ssomers:btree_fix_78903, r=Mark-SimulacrumMara Bos-16/+15
BTreeMap: fix minor testing mistakes in #78903 Mostly a duplicate test case r? `@Mark-Simulacrum`
2020-11-22BTreeMap: fix minor testing mistakes in #78903Stein Somers-16/+15
2020-11-21BTreeMap: address namespace conflictsStein Somers-23/+22
2020-11-18BTreeMap: reuse NodeRef as Root, keep BoxedNode for edges only, ban UniqueStein Somers-3/+3
2020-11-16Rollup merge of #78903 - ssomers:btree_order_chaos_testing, r=Mark-SimulacrumMara Bos-25/+197
BTreeMap: test chaotic ordering & other bits & bobs r? `@Mark-Simulacrum`
2020-11-13Add BTreeMap::retain and BTreeSet::retainMatt Brubeck-0/+11
2020-11-12BTreeMap: test chaotic ordering & other bits & bobsStein Somers-25/+197
2020-11-11Rollup merge of #78417 - ssomers:btree_chop_up_2, r=Mark-SimulacrumJonas Schievink-0/+27
BTreeMap: split off most code of append To complete #78056, move the last single-purpose pieces of code out of map.rs into a separate module. Also, tweaked documentation and safeness - I doubt think this code would be safe if the iterators passed in wouldn't be as sorted as the method says they should be - and bounds on MergeIterInner. r? ```@Mark-Simulacrum```
2020-11-09Rollup merge of #78437 - ssomers:btree_no_ord_at_node_level, r=Mark-SimulacrumDylan DPC-4/+22
BTreeMap: stop mistaking node for an orderly place A second mistake in #77612 was to ignore the node module's rightful comment "this module doesn't care whether the entries are sorted". And there's a much simpler way to visit the keys in order, if you check this separately from a single pass checking everything. r? ````````@Mark-Simulacrum````````
2020-11-08BTreeMap: split off most code of append, slightly improve interfacesStein Somers-0/+27
2020-11-07Rollup merge of #78538 - ssomers:btree_testing_rng, r=Mark-SimulacrumYuki Okushi-0/+1
BTreeMap: document a curious assumption in test cases r? ```@Mark-Simulacrum```
2020-10-30Constantify more BTreeMap and BTreeSet functionsBenoƮt du Garreau-0/+7
- BTreeMap::len - BTreeMap::is_empty - BTreeSet::len - BTreeSet::is_empty
2020-10-29BTreeMap: document a curious assumption in test casesStein Somers-0/+1
2020-10-27BTreeMap: stop mistaking node for an orderly placeStein Somers-4/+22
2020-10-24BTreeMap: stop mistaking node::MIN_LEN as a node level constraintStein Somers-2/+19
2020-10-19BTreeMap: test invariants more thoroughly and more readablyStein Somers-79/+10
2020-10-18Stabilize or_insert_with_keyChai T. Rex-2/+1
2020-10-12BTreeMap: refactor Entry out of map.rs into its own fileJacob Hughes-0/+475
btree/map.rs is approaching the 3000 line mark, splitting out the entry code buys about 500 lines of headroom
2020-10-04BTreeMap/Set: complete the compile-time test casesStein Somers-21/+37
2020-09-20BTreeMap: extra testing unveiling mistakes in future PRStein Somers-0/+19
2020-09-15Test and fix Sync & Send traits of BTreeMap artefactsStein Somers-0/+140
2020-09-09BTreeMap: avoid aliasing by avoiding slicesStein Somers-6/+9
2020-08-18BTreeMap: check some invariants, avoid recursion in depth first searchStein Somers-9/+223
2020-08-14Move btree unit test to their native, privileged locationStein Somers-0/+1491