mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-12 22:32:59 +00:00
30 lines
372 B
Rust
30 lines
372 B
Rust
|
#![warn(clippy::empty_drop)]
|
||
|
#![allow(unused)]
|
||
|
|
||
|
// should cause an error
|
||
|
struct Foo;
|
||
|
|
||
|
impl Drop for Foo {
|
||
|
fn drop(&mut self) {}
|
||
|
}
|
||
|
|
||
|
// shouldn't cause an error
|
||
|
struct Bar;
|
||
|
|
||
|
impl Drop for Bar {
|
||
|
fn drop(&mut self) {
|
||
|
println!("dropping bar!");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// should error
|
||
|
struct Baz;
|
||
|
|
||
|
impl Drop for Baz {
|
||
|
fn drop(&mut self) {
|
||
|
{}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {}
|