Use #![warn(let_underscore_drop)] in tests.

This commit is contained in:
Aaron Kofsky 2022-08-05 13:20:43 -04:00
parent d355ec94ff
commit 76c90c3015
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
// check-pass
// compile-flags: -W let_underscore_drop
#![warn(let_underscore_drop)]
struct NontrivialDrop;

View File

@ -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;