diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-29 16:38:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-29 16:38:24 -0700 |
| commit | 4230f96bbe45468a34dfdb0ca4204620be0b5686 (patch) | |
| tree | 967f420b2285e3e79419beaaa7ec7dd5e5ea066c /src/test/rustdoc-ui/coverage/json.rs | |
| parent | c07998e0e7ea182491aaad2a3cf82dfaabf64c0d (diff) | |
| parent | 821d50aa0cc73c1ec2fb09bab8a69e1c3ca93f23 (diff) | |
| download | rust-4230f96bbe45468a34dfdb0ca4204620be0b5686.tar.gz rust-4230f96bbe45468a34dfdb0ca4204620be0b5686.zip | |
Rollup merge of #74869 - tmiasko:must-use-closures, r=ecstatic-morse
Make closures and generators a must use types
Warn about unused expressions with closure or generator type. This follows
existing precedence of must use annotations present on `FnOnce`, `FnMut`, `Fn`
traits, which already indirectly apply to closures in some cases, e.g.,:
```rust
fn f() -> impl FnOnce() {
|| {}
}
fn main() {
// an existing warning: unused implementer of `std::ops::FnOnce` that must be used:
f();
// a new warning: unused closure that must be used:
|| {};
}
```
Closes #74691.
Diffstat (limited to 'src/test/rustdoc-ui/coverage/json.rs')
0 files changed, 0 insertions, 0 deletions
