about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-02-19 09:46:29 +0000
committerbors <bors@rust-lang.org>2019-02-19 09:46:29 +0000
commit075c212849ad2207c0b0ccbd0ec6cc5b1f392275 (patch)
treeef599c1d547203942bf3dabe51a3a5ad21de14c5 /library/std/src/sys/unix/stack_overflow.rs
parentd61b25419bec5a3e839fdb16f720cfb12e52ddf1 (diff)
parentbc4c3b6ff15f81e8e589b52b2098b929b4347449 (diff)
downloadrust-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 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions