1 #![warn(clippy::undropped_manually_drops)]
6 let f = std::mem::drop;
7 let g = std::mem::ManuallyDrop::drop;
8 let mut manual1 = std::mem::ManuallyDrop::new(S);
9 let mut manual2 = std::mem::ManuallyDrop::new(S);
10 let mut manual3 = std::mem::ManuallyDrop::new(S);
11 let mut manual4 = std::mem::ManuallyDrop::new(S);
13 // These lines will not drop `S` and should be linted
14 drop(std::mem::ManuallyDrop::new(S));
17 // FIXME: this line is not linted, though it should be
20 // These lines will drop `S` and should be okay.
22 std::mem::ManuallyDrop::drop(&mut std::mem::ManuallyDrop::new(S));
23 std::mem::ManuallyDrop::drop(&mut manual3);