diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/empty_drop.fixed')
-rw-r--r-- | src/tools/clippy/tests/ui/empty_drop.fixed | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/empty_drop.fixed b/src/tools/clippy/tests/ui/empty_drop.fixed new file mode 100644 index 000000000..2e1b76846 --- /dev/null +++ b/src/tools/clippy/tests/ui/empty_drop.fixed @@ -0,0 +1,24 @@ +// 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() {} |