Commit graph

15 commits

Author SHA1 Message Date
Yuri Astrakhan
9fd34e0c75 Use #[rustfmt::skip] 2023-05-22 20:02:45 -04:00
Yuri Astrakhan
e926148188 Fix unsafe blocks 2023-05-22 04:07:17 -04:00
Yuri Astrakhan
eb3970285b fallout: fix tests to allow uninlined_format_args
In order to switch `clippy::uninlined_format_args` from pedantic to
style, all existing tests must not raise a warning. I did not want to
change the actual tests, so this is a relatively minor change that:

* add `#![allow(clippy::uninlined_format_args)]` where needed
* normalizes all allow/deny/warn attributes
   * all allow attributes are grouped together
   * sorted alphabetically
   * the `clippy::*` attributes are listed separate from the other ones.
   * deny and warn attributes are listed before the allowed ones

changelog: none
2022-10-02 15:13:22 -04:00
Micha White
01c75e4b98
Added tests for Cow and Result 2022-06-10 13:12:02 -04:00
Micha White
6d6c63ee23
Lint single_match with Options, Results, and Cows 2022-06-10 13:11:50 -04:00
Jason Newcomb
63f6a79bf8 Don't lint various match lints when expanded by a proc-macro 2022-04-08 16:51:40 -04:00
Georgy Komarov
a5a07e503f 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
2022-01-20 15:14:25 +03:00
Esteban Kuber
652b6a771f update clippy 2021-08-11 14:21:33 +00:00
flip1995
ac912be984 Merge commit '95c0459217d1661edfa794c8bb122452b92fb485' into clippyup 2021-01-30 18:06:34 +01:00
flip1995
6f25adbd5a Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup 2020-07-14 14:59:59 +02:00
flip1995
7363728d18
Update remaining test files 2020-02-06 19:15:01 +01:00
Philipp Hansch
38d4ac7cea
Remove all copyright license headers
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2019-01-08 21:46:39 +01:00
flip1995
d2dbd0b8a5
Update *.stderr files 2018-12-28 12:41:12 +01:00
Matthias Krüger
7bcc2cd9c8 update test stderr 2018-12-10 08:22:07 +01:00
Philipp Hansch
3f72d4d630
Extract single_match_else UI test
There's only one test currently.
I also updated the lint doc with a 'good' example and changed the lint
help text a bit.

cc #2038
2018-12-04 07:20:13 +01:00