rust-clippy/tests/ui/empty_drop.fixed

22 lines
260 B
Rust
Raw Permalink Normal View History

#![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() {}