about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorGeorgy Komarov <jubnzv@gmail.com>2022-01-20 14:50:14 +0300
committerGeorgy Komarov <jubnzv@gmail.com>2022-01-20 15:14:25 +0300
commita5a07e503f524a0e8b92938301857b3007579115 (patch)
tree25fdd7b0da2584e1cd42c03b83d9db1cd8ec76fb /src/test/codegen/src-hash-algorithm
parent496f26c2297c0117a24c3d26172fd72b5f9ad927 (diff)
downloadrust-a5a07e503f524a0e8b92938301857b3007579115.tar.gz
rust-a5a07e503f524a0e8b92938301857b3007579115.zip
single_match: Don't lint non-exhaustive matches; support tuples
This commit changes the behavior of `single_match` lint.

After that, we won't lint non-exhaustive matches like this:

```rust
match Some(v) {
    Some(a) => println!("${:?}", a),
    None => {},
}
```

The rationale is that, because the type of `a` could be changed, so the
user can get non-exhaustive match after applying the suggested lint (see
https://github.com/rust-lang/rust-clippy/issues/8282#issuecomment-1013566068
for context).

We also will lint `match` constructions with tuples. When we see the
tuples on the both arms, we will check them both at the same time, and
if they form exhaustive match, we could display the warning.

Closes #8282
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions