about summary refs log tree commit diff
path: root/library/alloc/src/collections/btree
AgeCommit message (Collapse)AuthorLines
2023-12-10remove redundant importssurechen-9/+1
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-10-09Make BTreeSet::new_in constSven Bartscher-1/+1
2023-10-09Make BTreeMap::new_in constSven Bartscher-1/+1
Closes rust-lang/wg-allocators#118
2023-10-04Fix misuses of a vs ancui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-07-30Auto merge of #114236 - fee1-dead-contrib:rollup-m92j7q1, r=fee1-deadbors-0/+8
Rollup of 3 pull requests Successful merges: - #112151 (Clarify behavior of inclusive bounds in BTreeMap::{lower,upper}_bound) - #113512 (Updated lines doc to include trailing carriage return note) - #114203 (Effects: don't print `host` param in diagnostics) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-30Rollup merge of #112151 - chloekek:patch-1, r=workingjubileefee1-dead-0/+8
Clarify behavior of inclusive bounds in BTreeMap::{lower,upper}_bound It wasn’t quite clear to me how these methods would interpret inclusive bounds so I added examples for those.
2023-07-30Auto merge of #112280 - zica87:master, r=workingjubileebors-13/+0
Remove redundant example of `BTreeSet::iter` The usage and that `Values returned by the iterator are returned in ascending order` are already demonstrated by the other example and the description, so I removed the useless one.
2023-07-28btree/map.rs: remove "Basic usage" textTshepang Mbambo-54/+0
Not useful, for there is just a single example
2023-06-14s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedListThe 8472-92/+87
2023-06-14remove drain-on-drop behavior from BTree{Set,Map}::DrainFilter and add ↵The 8472-58/+40
#[must_use]
2023-06-13ignore core, alloc and test tests that require unwinding on panic=abortPietro Albini-0/+11
2023-06-04Remove redundant example of `BTreeSet::iter`zica-13/+0
2023-05-31Clarify behavior of inclusive bounds in BTreeMap::{lower,upper}_boundchloekek-0/+8
2023-05-15Fixed typoBenjamin Atelsek-1/+1
2023-05-04btree_map: `Cursor{,Mut}::peek_prev` must agreeJubilee Young-2/+21
Our `Cursor::peek_prev` and `CursorMut::peek_prev` must agree on how to behave when they are called on the "null element".
2023-04-29Rollup merge of #110958 - compiler-errors:stdlib-refinement, r=cuviperDylan DPC-16/+64
Make sure that some stdlib method signatures aren't accidental refinements In the process of implementing https://rust-lang.github.io/rfcs/3245-refined-impls.html, I found a bunch of stdlib implementations that accidentally "refined" their method signatures by dropping (unnecessary) bounds. This isn't currently a problem, but may become one if/when method signature refining is stabilized in the future. Shouldn't hurt to make these signatures a bit more accurate anyways. NOTE (just to be clear lol): This does not affect behavior at all, since we don't actually take advantage of refined implementations yet!
2023-04-28Make sure that signatures aren't accidental refinementsMichael Goulet-16/+64
2023-04-28replace version placeholdersPietro Albini-11/+11
2023-04-14Rollup merge of #110244 - kadiwa4:unnecessary_imports, r=JohnTitorMatthias Krüger-9/+4
Remove some unneeded imports / qualified paths Continuation of #105537.
2023-04-12remove some unneeded importsKaDiWa-9/+4
2023-04-12Fix btree `CursorMut::insert_after` checkmarc0246-1/+65
2023-03-25Auto merge of #99929 - the8472:default-iters, r=scottmcmbors-0/+179
Implement Default for some alloc/core iterators Add `Default` impls to the following collection iterators: * slice::{Iter, IterMut} * binary_heap::IntoIter * btree::map::{Iter, IterMut, Keys, Values, Range, IntoIter, IntoKeys, IntoValues} * btree::set::{Iter, IntoIter, Range} * linked_list::IntoIter * vec::IntoIter and these adapters: * adapters::{Chain, Cloned, Copied, Rev, Enumerate, Flatten, Fuse, Rev} For iterators which are generic over allocators it only implements it for the global allocator because we can't conjure an allocator from nothing or would have to turn the allocator field into an `Option` just for this change. These changes will be insta-stable. ACP: https://github.com/rust-lang/libs-team/issues/77
2023-03-20Remove outdated commentsMaybe Waffle-6/+0
2023-02-28Support allocators in various Default for IntoIter implsThe 8472-5/+17
Global implements Default so we can use that as bound for all allocators
2023-02-28rewrite iterator `Default` tests as doctestsThe 8472-16/+77
2023-02-28Implement Default for some alloc/core iteratorsThe 8472-0/+106
This way one can `mem::take()` them out of structs or #[derive(Default)] on structs containing them. These changes will be insta-stable.
2023-02-01BTreeMap: Add Cursor and CursorMutAmanieu d'Antras-5/+839
2023-02-01BTreeMap: Change internal insert function to return a handleAmanieu d'Antras-37/+119
This is a prerequisite for cursor support for `BTreeMap`.
2022-12-28fix documenting private items of standard libraryLukas Markeffsky-11/+17
2022-12-28Rollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514fee1-dead-239/+5
Test leaking of BinaryHeap Drain iterators Add test cases about forgetting the `BinaryHeap::Drain` iterator, and slightly fortifies some other test cases. Consists of separate commits that I don't think are relevant on their own (but I'll happily turn these into more PRs if desired).
2022-11-20replace unusual grammarTshepang Mbambo-2/+2
2022-11-14Auto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbinibors-12/+12
Bump bootstrap compiler to 1.66 This PR: - Bumps version placeholders to release - Bumps to latest beta - cfg-steps code r? `@pietroalbini`
2022-11-07disable btree size tests on MiriRalf Jung-0/+1
2022-11-06Bump version placeholders to releaseMark Rousskov-12/+12
2022-10-15Documentation BTreeMap::append's behavior for already existing keysphilipp-3/+6
2022-10-11Rollup merge of #101727 - est31:stabilize_map_first_last, r=m-ou-seMatthias Krüger-20/+10
Stabilize map_first_last Stabilizes the following functions: ```Rust impl<T> BTreeSet<T> { pub fn first(&self) -> Option<&T> where T: Ord; pub fn last(&self) -> Option<&T> where T: Ord; pub fn pop_first(&mut self) -> Option<T> where T: Ord; pub fn pop_last(&mut self) -> Option<T> where T: Ord; } impl<K, V> BTreeMap<K, V> { pub fn first_key_value(&self) -> Option<(&K, &V)> where K: Ord; pub fn last_key_value(&self) -> Option<(&K, &V)> where K: Ord; pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord; pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord; pub fn pop_first(&mut self) -> Option<(K, V)> where K: Ord; pub fn pop_last(&mut self) -> Option<(K, V)> where K: Ord; } ``` Closes #62924 ~~Blocked on the [FCP](https://github.com/rust-lang/rust/issues/62924#issuecomment-1179489929) finishing.~~ Edit: It finished!
2022-10-05Fix overconstrained Send impls in btree internalsDavid Tolnay-3/+3
2022-10-01Make `feature(const_btree_len)` implied by `feature(const_btree_new)`Maybe Waffle-4/+20
2022-09-30Stabilize map_first_lastest31-20/+10
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-23Stabilize const `BTree{Map,Set}::new`Nilstrieb-6/+6
Since `len` and `is_empty` are not const stable yet, this also creates a new feature for them since they previously used the same `const_btree_new` feature.
2022-09-02Fix internal doc linkChris Denton-1/+3
The doc link from `DedupSortedIter` to `BTreeMap::bulk_build_from_sorted_iter` was broken when building internal documentation,
2022-08-26Rollup merge of #95005 - ssomers:btree_static_assert, r=thomccGuillaume Gomez-7/+9
BTree: evaluate static type-related check at compile time `assert`s like the ones replaced here would only go off when you run the right test cases, if the code were ever incorrectly changed such that rhey would trigger. But [inspired on a nice forum question](https://users.rust-lang.org/t/compile-time-const-generic-parameter-check/69202), they can be checked at compile time.
2022-08-22Move error trait into coreJane Losare-Lusby-0/+11
2022-07-18Add `PhantomData` marker for dropck to `BTreeMap`Frank Steffahn-4/+26
closes #99408
2022-06-23Fix BTreeSet's range API panic message, documenttnballo-13/+117
2022-06-21remove use of &Alloc in btree testsRalf Jung-6/+6
2022-06-18make btree not use &A: Allocator instanceRalf Jung-6/+6
2022-06-17comments explaining why we have and don't have ManuallyDropRalf Jung-0/+6
2022-06-16btree: avoid forcing the allocator to be a referenceRalf Jung-241/+264