mirror of https://github.com/rust-lang/reference
Apply suggestions from code review
Co-authored-by: Eric Huss <eric@huss.org>
This commit is contained in:
parent
81fe01a111
commit
5baf87cdd9
|
@ -196,7 +196,7 @@ struct S {
|
||||||
pub fn f() {}
|
pub fn f() {}
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: `rustc` currently recognizes the tools "clippy", "rustfmt" and "diagnostics".
|
> Note: `rustc` currently recognizes the tools "clippy", "rustfmt" and "diagnostic".
|
||||||
|
|
||||||
## Built-in attributes index
|
## Built-in attributes index
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ The following is an index of all built-in attributes.
|
||||||
- [`allow`], [`warn`], [`deny`], [`forbid`] — Alters the default lint level.
|
- [`allow`], [`warn`], [`deny`], [`forbid`] — Alters the default lint level.
|
||||||
- [`deprecated`] — Generates deprecation notices.
|
- [`deprecated`] — Generates deprecation notices.
|
||||||
- [`must_use`] — Generates a lint for unused values.
|
- [`must_use`] — Generates a lint for unused values.
|
||||||
- [`diagnostic::on_unimplemented`] - Hints the compiler to emit a certain error
|
- [`diagnostic::on_unimplemented`] — Hints the compiler to emit a certain error
|
||||||
message if a trait is not implemented.
|
message if a trait is not implemented.
|
||||||
- ABI, linking, symbols, and FFI
|
- ABI, linking, symbols, and FFI
|
||||||
- [`link`] — Specifies a native library to link with an `extern` block.
|
- [`link`] — Specifies a native library to link with an `extern` block.
|
||||||
|
|
|
@ -315,7 +315,7 @@ The `#[diagnostic::on_unimplemented]` attribute is allowed to appear on trait de
|
||||||
|
|
||||||
The `note` option can appear several times, which results in several note messages being emitted. If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. Any other occurrence generates an lint warning. For any other non-existing option a lint-warning is generated.
|
The `note` option can appear several times, which results in several note messages being emitted. If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. Any other occurrence generates an lint warning. For any other non-existing option a lint-warning is generated.
|
||||||
|
|
||||||
All three options accept a text as argument. This text is allowed to contain format parameters referring to generic argument or `Self` by name via the `{Self}` or `{NameOfGenericArgument}` syntax. For any non-existing argument a lint warning is generated.
|
All three options accept a text as argument. This text is allowed to contain format parameters referring to generic argument or `Self` by name via the `{Self}` or `{NameOfGenericArgument}` syntax. Any other format parameter will generate a warning, but will otherwise be included in the string as-is.
|
||||||
|
|
||||||
This allows to have a trait definition like:
|
This allows to have a trait definition like:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue