mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-07 04:23:30 +00:00
Use #![warn(let_underscore_drop)]
in tests.
This commit is contained in:
parent
d355ec94ff
commit
76c90c3015
@ -1,5 +1,5 @@
|
||||
// check-pass
|
||||
// compile-flags: -W let_underscore_drop
|
||||
#![warn(let_underscore_drop)]
|
||||
|
||||
struct NontrivialDrop;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user