From 49c680ada001a4c296d1c00f58be8d8b535d50f6 Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Thu, 2 Sep 2021 17:19:43 +0200 Subject: [PATCH 1/4] Add "!" doc alias for `std::ops::Not` --- library/core/src/ops/bit.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/ops/bit.rs b/library/core/src/ops/bit.rs index 51f8043817345..92f45ac9e7ea9 100644 --- a/library/core/src/ops/bit.rs +++ b/library/core/src/ops/bit.rs @@ -30,6 +30,7 @@ /// ``` #[lang = "not"] #[stable(feature = "rust1", since = "1.0.0")] +#[doc(alias = "!")] pub trait Not { /// The resulting type after applying the `!` operator. #[stable(feature = "rust1", since = "1.0.0")] From ab89c88faadbc5a4063c8473c9ce28af16324d79 Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Thu, 2 Sep 2021 17:21:05 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Consistent=20placement=20of=20doc=20alias?= =?UTF-8?q?=20for=20primitives=20below=20the=20`doc(primitive=E2=80=A6)`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/std/src/primitive_docs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index dc4572cd9363b..045c1303b133f 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -385,8 +385,8 @@ mod prim_char {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_unit {} -#[doc(alias = "ptr")] #[doc(primitive = "pointer")] +#[doc(alias = "ptr")] // /// Raw, unsafe pointers, `*const T`, and `*mut T`. /// @@ -499,10 +499,10 @@ mod prim_unit {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_pointer {} +#[doc(primitive = "array")] #[doc(alias = "[]")] #[doc(alias = "[T;N]")] // unfortunately, rustdoc doesn't have fuzzy search for aliases #[doc(alias = "[T; N]")] -#[doc(primitive = "array")] /// A fixed-size array, denoted `[T; N]`, for the element type, `T`, and the /// non-negative compile-time constant size, `N`. /// From 2b69171dc2f0dec24478598abf844a8ff789ff86 Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Thu, 2 Sep 2021 17:37:53 +0200 Subject: [PATCH 3/4] Additional aliases for pointers --- library/std/src/primitive_docs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 045c1303b133f..09a6b932b960e 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -387,6 +387,9 @@ mod prim_unit {} #[doc(primitive = "pointer")] #[doc(alias = "ptr")] +#[doc(alias = "*")] +#[doc(alias = "*const")] +#[doc(alias = "*mut")] // /// Raw, unsafe pointers, `*const T`, and `*mut T`. /// From 5135d8692023359f4f04ca627a2571d6b8a0446a Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Thu, 2 Sep 2021 17:47:28 +0200 Subject: [PATCH 4/4] Mention usage of `const` in raw pointer types at the top of the keyword's documentation page. --- library/std/src/keyword_docs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs index 749a441d18263..3af941f59b689 100644 --- a/library/std/src/keyword_docs.rs +++ b/library/std/src/keyword_docs.rs @@ -119,7 +119,7 @@ mod break_keyword {} #[doc(keyword = "const")] // -/// Compile-time constants and compile-time evaluable functions. +/// Compile-time constants, compile-time evaluable functions, and raw pointers. /// /// ## Compile-time constants ///