2023-04-23 06:03:09 -05:00
|
|
|
//@run-rustfix
|
2022-05-05 09:12:52 -05:00
|
|
|
#![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() {}
|