mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-11 22:43:42 +00:00
Use #![warn(let_underscore_drop)]
in tests.
This commit is contained in:
parent
d355ec94ff
commit
76c90c3015
@ -1,5 +1,5 @@
|
|||||||
// check-pass
|
// check-pass
|
||||||
// compile-flags: -W let_underscore_drop
|
#![warn(let_underscore_drop)]
|
||||||
|
|
||||||
struct NontrivialDrop;
|
struct NontrivialDrop;
|
||||||
|
|
||||||
|
@ -4,7 +4,11 @@ warning: non-binding let on a type that implements `Drop`
|
|||||||
LL | let _ = NontrivialDrop;
|
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
|
help: consider binding to an unused variable to avoid immediately dropping the value
|
||||||
|
|
|
|
||||||
LL | let _unused = NontrivialDrop;
|
LL | let _unused = NontrivialDrop;
|
||||||
|
Loading…
Reference in New Issue
Block a user