Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc aliases for python and Java collections #81989

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "BTreeMap")]
#[doc(alias = "associative array")]
#[doc(alias = "dict")]
#[doc(alias = "map")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that you're adding map to BTreeMap, do you want to add set to BTreeSet? Either way they should show up in the results though, so not really necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks. Added.

Either way they should show up in the results though, so not really necessary.

This will make it show up in the top, right now it's a long way down. image

pub struct BTreeMap<K, V> {
root: Option<Root<K, V>>,
length: usize,
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ use super::Recover;
#[derive(Hash, PartialEq, Eq, Ord, PartialOrd)]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "BTreeSet")]
#[doc(alias = "set")]
pub struct BTreeSet<T> {
map: BTreeMap<T, ()>,
}
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ mod spec_extend;
/// [`&`]: ../../std/primitive.reference.html
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")]
#[doc(alias = "list")]
pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
buf: RawVec<T, A>,
len: usize,
Expand Down
3 changes: 3 additions & 0 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ use crate::sys;

#[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_type")]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(alias = "associative array")]
#[doc(alias = "dict")]
#[doc(alias = "map")]
pub struct HashMap<K, V, S = RandomState> {
base: base::HashMap<K, V, S>,
}
Expand Down
1 change: 1 addition & 0 deletions library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ use super::map::{map_try_reserve_error, RandomState};
/// [`Cell`]: crate::cell::Cell
#[cfg_attr(not(test), rustc_diagnostic_item = "hashset_type")]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(alias = "set")]
jyn514 marked this conversation as resolved.
Show resolved Hide resolved
pub struct HashSet<T, S = RandomState> {
base: base::HashSet<T, S>,
}
Expand Down