Skip to content

Commit 61fc7f1

Browse files
Add struct keyword doc
1 parent bf1e461 commit 61fc7f1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/libstd/keyword_docs.rs

+21
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,24 @@ mod fn_keyword { }
5656
///
5757
/// [book]: https://doc.rust-lang.org/book/second-edition/ch03-01-variables-and-mutability.html
5858
mod let_keyword { }
59+
60+
#[doc(keyword = "struct")]
61+
//
62+
/// The `struct` keyword.
63+
///
64+
/// The `struct` keyword is used to define a struct type.
65+
///
66+
/// Example:
67+
///
68+
/// ```
69+
/// struct Foo {
70+
/// field1: u32,
71+
/// field2: String,
72+
/// }
73+
/// ```
74+
///
75+
/// There are different kinds of structs. For more information, take a look at the
76+
/// [Rust Book][book].
77+
///
78+
/// [book]: https://doc.rust-lang.org/book/second-edition/ch05-01-defining-structs.html
79+
mod struct_keyword { }

0 commit comments

Comments
 (0)