Commit graph

4 commits

Author SHA1 Message Date
flip1995
840eac2c05
Use {get,match}_def_path from LateContext 2019-04-17 12:53:29 +02:00
Andy Russell
fe96ffeac9
move lint documentation into macro invocations 2019-03-05 18:45:08 -05:00
Michael Howell
bc4c3b6ff1 Add more descriptive details 2019-02-18 19:37:08 -07:00
Michael Howell
2df14c3701 Add a lint to warn on T: Drop bounds
**What it does:** Checks for generics with `std::ops::Drop` as bounds.

**Why is this bad?** `Drop` bounds do not really accomplish anything.
A type may have compiler-generated drop glue without implementing the
`Drop` trait itself. The `Drop` trait also only has one method,
`Drop::drop`, and that function is by fiat not callable in user code.
So there is really no use case for using `Drop` in trait bounds.

**Known problems:** None.

**Example:**
```rust
fn foo<T: Drop>() {}
```
2019-02-17 22:53:08 -07:00