rust/clippy_utils/src
bors aa033440da Auto merge of #8797 - xFrednet:0000-expect-a-playground, r=flip1995
Replace `#[allow]` with `#[expect]` in Clippy

Hey `@rust-lang/clippy,` `@Alexendoo,` `@dswij,` I'm currently working on the expect attribute as defined in [Rust RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html). With that, an `#[allow]` attribute can be replaced with a `#[expect]` attribute that suppresses the lint, but also emits a warning, if the lint isn't emitted in the expected scope.

With this PR I would like to test the attribute on a project scale and Clippy obviously came to mind. This PR replaces (almost) all `#[allow]` attributes in `clippy_utils` and `clippy_lints` with the `#[expect]` attribute. I was also able to remove some allows since, the related FPs have been fixed 🎉.

My question is now, are there any concerns regarding this? It's still okay to add normal `#[allow]` attributes, I see the need to nit-pick about that in new PRs, unless it's actually a FP. Also, I would not recommend using `#[expect]` in tests, as changes to a lint could the trigger the expect attribute in other files.

Additionally, I've noticed that Clippy has a bunch of `#[allow(clippy::too_many_lines)]` attributes. Should we maybe allow the lint all together or increase the threshold setting? To me, it seems like we mostly just ignore it in our code. 😅 🙃

---

changelog: none

r? `@flip1995` (I've requested you for now, since you're also helping with reviewing the expect implementation. You are welcome to delegate this PR, even if it should be a simple review 🙃 )
2022-05-09 17:14:43 +00:00
..
ast_utils Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ast_utils.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
attrs.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
comparisons.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
consts.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
diagnostics.rs Merge remote-tracking branch 'upstream/master' into rustup 2022-04-07 15:44:37 +01:00
eager_or_lazy.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
higher.rs Merge commit '57b3c4b90f' into clippyup 2022-02-10 18:40:06 +01:00
hir_utils.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
lib.rs Auto merge of #8797 - xFrednet:0000-expect-a-playground, r=flip1995 2022-05-09 17:14:43 +00:00
macros.rs adding spell checking 2022-04-15 14:18:09 -07:00
msrvs.rs Merge commit '984330a6ee' into clippyup 2022-04-08 10:06:10 +01:00
numeric_literal.rs New lint is_digit_ascii_radix 2022-04-07 14:14:30 -06:00
paths.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
ptr.rs Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
qualify_min_const_fn.rs Pass msrvs by copy 2022-05-08 07:13:14 -04:00
source.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
str_utils.rs Merge commit '0eff589afc' into clippyup 2021-12-30 15:10:43 +01:00
sugg.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
sym_helper.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ty.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
usage.rs Replace #[allow] with #[expect] in Clippy 2022-05-07 17:39:21 +02:00
visitors.rs Allow more complex expressions in let_unit_value 2022-04-14 21:34:33 -04:00