diff options
author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-09-02 15:28:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 15:28:50 -0700 |
commit | dfe0f88de8b3d367d0e096ae2c6156bb4dd2b2f2 (patch) | |
tree | 7d7e848d33b47e84388a0f93b33bbeeb257cfbda /src/doc/reference.md | |
parent | ef9786ce0eac75bbe293d04dadc959bd481236a6 (diff) | |
parent | 0384722357d4a6dcc2a1e79b41cf9f0df50cb577 (diff) | |
download | rust-dfe0f88de8b3d367d0e096ae2c6156bb4dd2b2f2.tar.gz |
Rollup merge of #35754 - QuietMisdreavus:must-use-reference, r=Manishearth
Add `must_use` to the Reference
I'm a bit uncertain about the exact phrasing, but having it mentioned at all is probably better than before.
Diffstat (limited to 'src/doc/reference.md')
-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 ec2d3e2822e..cc5d9c3685a 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2071,6 +2071,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 |