Skip to content

Commit

Permalink
Use #![warn(let_underscore_drop)] in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
a2aaron committed Aug 5, 2022
1 parent d355ec9 commit 76c90c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/lint/let_underscore/let_underscore_drop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-pass
// compile-flags: -W let_underscore_drop
#![warn(let_underscore_drop)]

struct NontrivialDrop;

Expand Down
6 changes: 5 additions & 1 deletion src/test/ui/lint/let_underscore/let_underscore_drop.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ warning: non-binding let on a type that implements `Drop`
LL | let _ = NontrivialDrop;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: requested on the command line with `-W let-underscore-drop`
note: the lint level is defined here
--> $DIR/let_underscore_drop.rs:2:9
|
LL | #![warn(let_underscore_drop)]
| ^^^^^^^^^^^^^^^^^^^
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let _unused = NontrivialDrop;
Expand Down

0 comments on commit 76c90c3

Please sign in to comment.