File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,9 @@ fn main() {
400
400
401
401
When used on a function, if the [ expression] of an
402
402
[ expression statement] is a [ call expression] to that function, then the
403
- ` unused_must_use ` lint is violated.
403
+ ` unused_must_use ` lint is violated. The exceptions to this is if the return type
404
+ of the function is ` () ` , ` ! ` , or a [ zero-variant enum] , in which case the
405
+ attribute does nothing.
404
406
405
407
``` rust
406
408
#[must_use]
@@ -513,4 +515,5 @@ You can implement `derive` for your own type through [procedural macros].
513
515
[ block expression ] : expressions/block-expr.html
514
516
[ `Drop` ] : special-types-and-traits.html#drop
515
517
[ let statement ] : statements.html#let-statements
516
- [ unstable book plugin ] : ../unstable-book/language-features/plugin.html#lint-plugins
518
+ [ unstable book plugin ] : ../unstable-book/language-features/plugin.html#lint-plugins
519
+ [ zero-variant enum ] : enumerations.html#zero-variant-enums
You can’t perform that action at this time.
0 commit comments