]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/empty_drop.rs
Rollup merge of #99474 - aDotInTheVoid:rustdoc-json-noinline-test-cleanup, r=CraftSpider
[rust.git] / src / tools / clippy / tests / ui / empty_drop.rs
1 // run-rustfix
2 #![warn(clippy::empty_drop)]
3 #![allow(unused)]
4
5 // should cause an error
6 struct Foo;
7
8 impl Drop for Foo {
9     fn drop(&mut self) {}
10 }
11
12 // shouldn't cause an error
13 struct Bar;
14
15 impl Drop for Bar {
16     fn drop(&mut self) {
17         println!("dropping bar!");
18     }
19 }
20
21 // should error
22 struct Baz;
23
24 impl Drop for Baz {
25     fn drop(&mut self) {
26         {}
27     }
28 }
29
30 fn main() {}