rust/book/src
Samuel Tardieu a8d1258ba7
feat(multiple_inherent_impl): Add config option to target specific scope (#15843)
Add a config option `inherent-impl-lint-scope` to the lint
`multiple_inherent_impl` to target a different scope according to
people's needs. It can take three values: `module`, `file`, and `crate`
(default).

- `module` is the weakest option. It lints if there are two or more
impls in the same module.
- `file` is a bit stronger, since it lints if there are two or more
impls in the same file. So, this triggers the lint (where it did not
with module):
- `crate` is the strongest of them; it triggers as soon as there are two
or more impls anywhere in the crate. It is the current behaviour of the
lint, so it's the default option.

changelog: [`multiple_inherent_impl`] : Add config option (`module`,
`file` or `crate`) to target specific scope

fixes rust-lang/rust-clippy#14867
2025-10-13 05:07:54 +00:00
..
continuous_integration Update actions/checkouts to v5 2025-08-11 19:40:49 +05:00
development book: import implements_trait from clippy_utils::ty 2025-10-11 10:18:44 +02:00
attribs.md Fix docs for #[clippy::format_args] 2025-02-06 03:21:49 -05:00
configuration.md Merge commit '3e5a02b13b' into clippy-subtree-update 2024-06-13 12:30:48 +02:00
installation.md Merge commit '83e42a2337' into clippyup 2023-04-11 15:31:08 +02:00
lint_configuration.md feat(multiple_inherent_impl): Add config option to target specific scope (#15843) 2025-10-13 05:07:54 +00:00
lints.md Add Nursery and Deprecated lints section at Book 2025-02-05 23:09:08 +05:00
README.md Remove automatic feature freeze comment 2025-09-17 18:46:08 +02:00
SUMMARY.md Remove automatic feature freeze comment 2025-09-17 18:46:08 +02:00
usage.md remove clippy::double_neg 2025-01-26 12:15:12 +01:00

Clippy

License: MIT OR Apache-2.0

A collection of lints to catch common mistakes and improve your Rust code.

There are over 750 lints included in this crate!

Lints are divided into categories, each with a default lint level. You can choose how much Clippy is supposed to annoy help you by changing the lint level by category.

Category Description Default level
clippy::all all lints that are on by default (correctness, suspicious, style, complexity, perf) warn/deny
clippy::correctness code that is outright wrong or useless deny
clippy::suspicious code that is most likely wrong or useless warn
clippy::style code that should be written in a more idiomatic way warn
clippy::complexity code that does something simple but in a complex way warn
clippy::perf code that can be written to run faster warn
clippy::pedantic lints which are rather strict or have occasional false positives allow
clippy::restriction lints which prevent the use of language and library features1 allow
clippy::nursery new lints that are still under development allow
clippy::cargo lints for the cargo manifest allow

More to come, please file an issue if you have ideas!

The restriction category should, emphatically, not be enabled as a whole. The contained lints may lint against perfectly reasonable code, may not have an alternative suggestion, and may contradict any other lints (including other categories). Lints should be considered on a case-by-case basis before enabling.


  1. Some use cases for restriction lints include:

    ↩︎