about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/coverage/json.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-29 16:38:24 -0700
committerGitHub <noreply@github.com>2020-07-29 16:38:24 -0700
commit4230f96bbe45468a34dfdb0ca4204620be0b5686 (patch)
tree967f420b2285e3e79419beaaa7ec7dd5e5ea066c /src/test/rustdoc-ui/coverage/json.rs
parentc07998e0e7ea182491aaad2a3cf82dfaabf64c0d (diff)
parent821d50aa0cc73c1ec2fb09bab8a69e1c3ca93f23 (diff)
downloadrust-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