diff options
| author | bors <bors@rust-lang.org> | 2019-02-19 09:46:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-02-19 09:46:29 +0000 |
| commit | 075c212849ad2207c0b0ccbd0ec6cc5b1f392275 (patch) | |
| tree | ef599c1d547203942bf3dabe51a3a5ad21de14c5 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | d61b25419bec5a3e839fdb16f720cfb12e52ddf1 (diff) | |
| parent | bc4c3b6ff15f81e8e589b52b2098b929b4347449 (diff) | |
| download | rust-075c212849ad2207c0b0ccbd0ec6cc5b1f392275.tar.gz rust-075c212849ad2207c0b0ccbd0ec6cc5b1f392275.zip | |
Auto merge of #3776 - notriddle:drop-bounds, r=oli-obk
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>() {}
```
Fixes #3773
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
