Useless exponent
Closes#7745
I'm open to some thoughts on dropping the exponents on suggestions when it's zero. I personally don't see any problem on this.
changelog: [`useless_exponent`] suggestion drops exponent when exponent value is zero
Move module declarations back into lib.rs
With #7673 we moved a lot of things from lib.rs to lib.foo.rs. Unfortunately, rustfmt doesn't seem to work when module declarations are included via `include!` (and trying the `mod foo; use foo::*;` trick doesn't seem to work much either in our specific case).
With this PR we continue generating everything in subfiles except for module declarations, which are now generated within lib.rs.
changelog: none
improved help message for `suspicious_map`
`suspicious_map`'s help message assumes that the literal behavior is never the intended one, although it's sometimes. This PR adds a mention of `inspect`, offering a idiomatic alternative.
fixes#7767
---
changelog: Improved help message of [`suspicious_map`].
Add lint `equatable_if_let`
This is my attempt for #1716. There is a major false positive, which is people may implement `PartialEq` in a different way. It is unactionable at the moment so I put it into `nursery`.
There is a trait `StructuralPartialEq` for solving this problem which is promising but it has several problems currently:
* Integers and tuples doesn't implement it.
* Some types wrongly implement it, like `Option<T>` when `T` doesn't implement it.
I consider them bugs and against the propose of `StructuralPartialEq`. When they become fixed, this lint can become a useful lint with a single line change.
changelog: New lint: [`equatable_if_let`]
Correctly handle signs in exponents in numeric_literal::format()
Fixes#7744
changelog: Correctly handle signs in exponents in `numeric_literal::format()`
Re-write shadow lints
changelog: Move shadow_unrelated to restriction
changelog: The shadow lints find a lot more shadows and are not limited to certain patterns
Drastically simplifies the implementation. Catches a lot more cases.
I removed the "initialization happens here" note. It is not helpful IMO.
Closes#318Fixes#2890Fixes#6563Fixes#7588Fixes#7620
fix bug for large_enum_variants
Fix the discussion problem in the issue of https://github.com/rust-lang/rust-clippy/issues/7666#issuecomment-919654291
About the false positive problem of case:
```rust
enum LargeEnum6 {
A,
B([u8;255]),
C([u8;200]),
}
```
changelog: Fix largest_enum_variant wrongly identifying the second largest variant.