diff options
| author | QuietMisdreavus <bryan@icesoldier.me> | 2016-08-17 11:49:28 -0500 |
|---|---|---|
| committer | QuietMisdreavus <bryan@icesoldier.me> | 2016-08-17 14:32:32 -0500 |
| commit | 0384722357d4a6dcc2a1e79b41cf9f0df50cb577 (patch) | |
| tree | e4fdb365871dcbfa51d2e85221319fe77852a739 | |
| parent | 6c0d66af693dc960e042631643b0d76a05a4b9a9 (diff) | |
| download | rust-0384722357d4a6dcc2a1e79b41cf9f0df50cb577.tar.gz rust-0384722357d4a6dcc2a1e79b41cf9f0df50cb577.zip | |
Add `must_use` to the Reference
| -rw-r--r-- | src/doc/reference.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index f0ab1488d40..d14322a0655 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2070,6 +2070,9 @@ macro scope. trait of the same name. `{Self}` will be replaced with the type that is supposed to implement the trait but doesn't. To use this, the `on_unimplemented` feature gate must be enabled. +- `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. ### Conditional compilation |
