Skip to content

Link to the rustdoc book for doc attribute docs. #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,17 @@ macro scope.
object file that this item's contents will be placed into.
- `no_mangle` - on any item, do not apply the standard name mangling. Set the
symbol for this item to its identifier.
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
- `must_use` - on structs and enums, will warn if a value of this type isn't used or
assigned to a variable. You may also include an optional message by using
`#[must_use = "message"]` which will be given alongside the warning.

### Documentation

The `doc` attribute is used to document items and fields. [Doc comments]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be a link anchor? I can't find its reference link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Forgot to add it. Added and rebased.

are transformed into `doc` attributes.

See [The Rustdoc Book] for reference material on this attribute.

### Conditional compilation

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

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

[procedural macros]: procedural-macros.html
[Doc comments]: comments.html#doc-comments
[The Rustdoc Book]: ../rustdoc/the-doc-attribute.html
[procedural macros]: procedural-macros.html