about summary refs log tree commit diff
path: root/library/std/src/keyword_docs.rs
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2023-08-21 18:32:58 +0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2023-08-21 20:00:43 +0700
commit53245709f68280943b4d2a3995883fc1b90087f9 (patch)
treecee4a5e55648f820ab1918deea3040430b91abc3 /library/std/src/keyword_docs.rs
parentc40cfcf0494ff7506e753e750adb00eeea839f9c (diff)
downloadrust-53245709f68280943b4d2a3995883fc1b90087f9.tar.gz
rust-53245709f68280943b4d2a3995883fc1b90087f9.zip
docs: Add example, reference link for `type` keyword.
Fixes #114281.
Diffstat (limited to 'library/std/src/keyword_docs.rs')
-rw-r--r--library/std/src/keyword_docs.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs
index eb46f4e54bb..873bfb6218b 100644
--- a/library/std/src/keyword_docs.rs
+++ b/library/std/src/keyword_docs.rs
@@ -1820,7 +1820,7 @@ mod true_keyword {}
 
 #[doc(keyword = "type")]
 //
-/// Define an alias for an existing type.
+/// Define an [alias] for an existing type.
 ///
 /// The syntax is `type Name = ExistingType;`.
 ///
@@ -1838,6 +1838,13 @@ mod true_keyword {}
 /// assert_eq!(m, k);
 /// ```
 ///
+/// A type can be generic:
+///
+/// ```rust
+/// # use std::sync::{Arc, Mutex};
+/// type ArcMutex<T> = Arc<Mutex<T>>;
+/// ```
+///
 /// In traits, `type` is used to declare an [associated type]:
 ///
 /// ```rust
@@ -1860,6 +1867,7 @@ mod true_keyword {}
 ///
 /// [`trait`]: keyword.trait.html
 /// [associated type]: ../reference/items/associated-items.html#associated-types
+/// [alias]: ../reference/items/type-aliases.html
 mod type_keyword {}
 
 #[doc(keyword = "unsafe")]