rust/tests/ui/empty_drop.fixed

24 lines
262 B
Rust
Raw Normal View History

2022-03-25 14:31: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() {}