Skip to content

Commit 508674a

Browse files
Merge pull request #174 from Havvy/attribute-doc
Link to the rustdoc book for doc attribute docs.
2 parents de1dc99 + 9dcc74c commit 508674a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/attributes.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,17 @@ macro scope.
184184
object file that this item's contents will be placed into.
185185
- `no_mangle` - on any item, do not apply the standard name mangling. Set the
186186
symbol for this item to its identifier.
187-
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
188187
- `must_use` - on structs and enums, will warn if a value of this type isn't used or
189188
assigned to a variable. You may also include an optional message by using
190189
`#[must_use = "message"]` which will be given alongside the warning.
191190

191+
### Documentation
192+
193+
The `doc` attribute is used to document items and fields. [Doc comments]
194+
are transformed into `doc` attributes.
195+
196+
See [The Rustdoc Book] for reference material on this attribute.
197+
192198
### Conditional compilation
193199

194200
Sometimes one wants to have different compiler outputs from the same code,
@@ -408,4 +414,6 @@ impl<T: PartialEq> PartialEq for Foo<T> {
408414

409415
You can implement `derive` for your own type through [procedural macros].
410416

411-
[procedural macros]: procedural-macros.html
417+
[Doc comments]: comments.html#doc-comments
418+
[The Rustdoc Book]: ../rustdoc/the-doc-attribute.html
419+
[procedural macros]: procedural-macros.html

0 commit comments

Comments
 (0)