Skip to content

Commit 0384722

Browse files
author
QuietMisdreavus
committed
Add must_use to the Reference
1 parent 6c0d66a commit 0384722

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/doc/reference.md

+3
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,9 @@ macro scope.
20702070
trait of the same name. `{Self}` will be replaced with the type that is supposed
20712071
to implement the trait but doesn't. To use this, the `on_unimplemented` feature gate
20722072
must be enabled.
2073+
- `must_use` - on structs and enums, will warn if a value of this type isn't used or
2074+
assigned to a variable. You may also include an optional message by using
2075+
`#[must_use = "message"]` which will be given alongside the warning.
20732076

20742077
### Conditional compilation
20752078

0 commit comments

Comments
 (0)