Skip to content

Commit

Permalink
Rollup merge of rust-lang#35754 - QuietMisdreavus:must-use-reference,…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
Jonathan Turner authored Sep 2, 2016
2 parents ef9786c + 0384722 commit dfe0f88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit dfe0f88

Please sign in to comment.