diff options
| author | bors <bors@rust-lang.org> | 2022-01-16 17:22:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-16 17:22:57 +0000 |
| commit | bd3cb52565faab2755ff1bdb54d88bc91f47b4b9 (patch) | |
| tree | 62cae2960feaabe7d5bd0362032102cd48621b3d /library/alloc/src | |
| parent | 48e89b00caa94829a5f07e0f1ecb33bf37431244 (diff) | |
| parent | 2b6b49e1d7f1d818b48dbbca11c49f672e25e6ca (diff) | |
Auto merge of #92970 - matthiaskrgr:rollup-tcx7cfb, r=matthiaskrgr
Rollup of 10 pull requests
Successful merges:
- #92487 (Fix unclosed boxes in pretty printing of TraitAlias)
- #92581 (ARMv6K Horizon - Enable default libraries)
- #92619 (Add diagnostic items for macros)
- #92635 (rustdoc: Yet more intra-doc links cleanup)
- #92646 (feat: rustc_pass_by_value lint attribute)
- #92706 (Clarify explicitly that BTree{Map,Set} are ordered.)
- #92710 (Include Projections when elaborating TypeOutlives)
- #92746 (Parse `Ty?` as `Option<Ty>` and provide structured suggestion)
- #92792 (rustdoc: fix intra-link for generic trait impls)
- #92814 (remove unused FIXME)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/btree/map.rs | 6 | ||||
| -rw-r--r-- | library/alloc/src/collections/btree/set.rs | 5 | ||||
| -rw-r--r-- | library/alloc/src/collections/mod.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/macros.rs | 1 |
4 files changed, 12 insertions, 4 deletions
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 62153efbb39..794b9356e7c 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -34,7 +34,7 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT; // An empty map is represented either by the absence of a root node or by a // root node that is an empty leaf. -/// A map based on a [B-Tree]. +/// An ordered map based on a [B-Tree]. /// /// B-Trees represent a fundamental compromise between cache-efficiency and actually minimizing /// the amount of work performed in a search. In theory, a binary search tree (BST) is the optimal @@ -68,6 +68,10 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT; /// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined /// behavior. /// +/// Iterators obtained from functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or +/// [`BTreeMap::keys`] produce their items in order by key, and take worst-case logarithmic and +/// amortized constant time per item returned. +/// /// [B-Tree]: https://en.wikipedia.org/wiki/B-tree /// [`Cell`]: core::cell::Cell /// [`RefCell`]: core::cell::RefCell diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index 394c21bf51c..31df4e98ed7 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -15,7 +15,7 @@ use super::Recover; // FIXME(conventions): implement bounded iterators -/// A set based on a B-Tree. +/// An ordered set based on a B-Tree. /// /// See [`BTreeMap`]'s documentation for a detailed discussion of this collection's performance /// benefits and drawbacks. @@ -27,6 +27,9 @@ use super::Recover; /// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined /// behavior. /// +/// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case +/// logarithmic and amortized constant time per item returned. +/// /// [`Ord`]: core::cmp::Ord /// [`Cell`]: core::cell::Cell /// [`RefCell`]: core::cell::RefCell diff --git a/library/alloc/src/collections/mod.rs b/library/alloc/src/collections/mod.rs index 1ea135a2aed..628a5b15567 100644 --- a/library/alloc/src/collections/mod.rs +++ b/library/alloc/src/collections/mod.rs @@ -14,7 +14,7 @@ pub mod vec_deque; #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] pub mod btree_map { - //! A map based on a B-Tree. + //! An ordered map based on a B-Tree. #[stable(feature = "rust1", since = "1.0.0")] pub use super::btree::map::*; } @@ -22,7 +22,7 @@ pub mod btree_map { #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] pub mod btree_set { - //! A set based on a B-Tree. + //! An ordered set based on a B-Tree. #[stable(feature = "rust1", since = "1.0.0")] pub use super::btree::set::*; } diff --git a/library/alloc/src/macros.rs b/library/alloc/src/macros.rs index 189da9f0639..d3e9e65c3fe 100644 --- a/library/alloc/src/macros.rs +++ b/library/alloc/src/macros.rs @@ -37,6 +37,7 @@ #[cfg(not(test))] #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] +#[rustc_diagnostic_item = "vec_macro"] #[allow_internal_unstable(box_syntax, liballoc_internals)] macro_rules! vec { () => ( |
