diff options
Diffstat (limited to 'src/tools/clippy/src/docs/drop_non_drop.txt')
-rw-r--r-- | src/tools/clippy/src/docs/drop_non_drop.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/drop_non_drop.txt b/src/tools/clippy/src/docs/drop_non_drop.txt new file mode 100644 index 000000000..ee1e3a6c2 --- /dev/null +++ b/src/tools/clippy/src/docs/drop_non_drop.txt @@ -0,0 +1,13 @@ +### What it does +Checks for calls to `std::mem::drop` with a value that does not implement `Drop`. + +### Why is this bad? +Calling `std::mem::drop` is no different than dropping such a type. A different value may +have been intended. + +### Example +``` +struct Foo; +let x = Foo; +std::mem::drop(x); +```
\ No newline at end of file |