mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 21:53:23 +00:00
25 lines
277 B
Rust
25 lines
277 B
Rust
|
// run-rustfix
|
||
|
#![warn(clippy::empty_drop)]
|
||
|
#![allow(unused)]
|
||
|
|
||
|
// should cause an error
|
||
|
struct Foo;
|
||
|
|
||
|
|
||
|
|
||
|
// shouldn't cause an error
|
||
|
struct Bar;
|
||
|
|
||
|
impl Drop for Bar {
|
||
|
fn drop(&mut self) {
|
||
|
println!("dropping bar!");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// should error
|
||
|
struct Baz;
|
||
|
|
||
|
|
||
|
|
||
|
fn main() {}
|