]> git.lizzy.rs Git - rust.git/blob - src/docs/drop_non_drop.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / drop_non_drop.txt
1 ### What it does
2 Checks for calls to `std::mem::drop` with a value that does not implement `Drop`.
3
4 ### Why is this bad?
5 Calling `std::mem::drop` is no different than dropping such a type. A different value may
6 have been intended.
7
8 ### Example
9 ```
10 struct Foo;
11 let x = Foo;
12 std::mem::drop(x);
13 ```