]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/let_underscore_drop.rs
Add 'src/tools/rustfmt/' from commit '7872306edf2e11a69aaffb9434088fd66b46a863'
[rust.git] / src / tools / clippy / tests / ui / let_underscore_drop.rs
1 #![warn(clippy::let_underscore_drop)]
2
3 struct Droppable;
4
5 impl Drop for Droppable {
6     fn drop(&mut self) {}
7 }
8
9 fn main() {
10     let unit = ();
11     let boxed = Box::new(());
12     let droppable = Droppable;
13     let optional = Some(Droppable);
14
15     let _ = ();
16     let _ = Box::new(());
17     let _ = Droppable;
18     let _ = Some(Droppable);
19
20     // no lint for reference
21     let _ = droppable_ref();
22 }
23
24 #[must_use]
25 fn droppable_ref() -> &'static mut Droppable {
26     unimplemented!()
27 }