Skip to content

Commit b758cbd

Browse files
authored
Rollup merge of #149232 - madsmtm:vec-doc-aliases, r=Noratrieb
Add doc aliases "vector" and "list" to `Vec` - "vector" is what "vec" is short form for. - "list" is a common name for this concept in a lot of other languages (`ArrayList` in Java, `list` in Python, `List` in C#). C++ uses the term for a linked list (`std::list`), so maybe this is contentious? I believe that this falls under [the doc alias policy](https://std-dev-guide.rust-lang.org/policy/doc-alias.html), and I think it's plausible that a newcomer would search for either of these terms, and expect to find `Vec`. r? libs
2 parents fdcf1f2 + 1111730 commit b758cbd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/alloc/src/vec/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ mod spec_extend;
433433
#[stable(feature = "rust1", since = "1.0.0")]
434434
#[rustc_diagnostic_item = "Vec"]
435435
#[rustc_insignificant_dtor]
436+
#[doc(alias = "list")]
437+
#[doc(alias = "vector")]
436438
pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
437439
buf: RawVec<T, A>,
438440
len: usize,

0 commit comments

Comments
 (0)