lintcheck: add --fix mode which tries to apply lint suggestions to th…
…e sources and prints a warning if that fails
Great for spotting false positives/broken suggestions of applicable lints.
There are false positives though because I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differentiate between clippy and rustc warnings when applying lint suggestions.
changelog: none
Remove a couple MIR usages
changelog: none
We use MIR to get the return type of a closure/function in a couple places. But typeck seems like a better approach.
This is the easy part of #6080.
Also did a tiny cleanup with `typeck` -> `typeck_body`.
Great for spotting false positives/broken suggestions of applicable lints.
There are false positives though becasue I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differenciate between clippy and rustc warnings when applying lint suggestions.
changelog: none
Dogfood and CI fixes
The CI fix is practically #6829 rebased and squashed into one commit
Dogfood fix is a follow up of #6802
r? `@matthiaskrgr` for lintcheck changes
(best reviewed with whitespace changes hidden)
changelog: none
lintcheck: add test (but don't run on ci)
This is the rest of https://github.com/rust-lang/rust-clippy/pull/6829 but without adding anything to ci
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: none
Compare empty blocks for equality based on tokens
fixes: #1390
This only considers empty blocks for now, though we should also catch something like this:
```rust
match 0 {
0 => {
do_something();
trace!(0);
0
}
1 => {
do_something();
trace!(1);
1
}
x => x,
}
```
As far as I can tell there aren't any negative effects on other lints. These blocks only happen to be the same for a given compilation, not all compilations.
changelog: Fix `match_on_same_arms` and others. Only consider empty blocks equal if the tokens contained are the same.
Fix `manual_map` false positives
fixes: #6795fixes: #6797fixes: #6811fixes: #6819
changelog: Fix false positives for `manual_map` when `return`, `break`, `continue`, `yield`, `await`, and partially moved values are used.
changelog: Don't expand macros in suggestions for `manual_map`
Refactor: arrange transmute lints
This PR arranges `transmute` lints so that they can be accessed more easily.
Basically, I followed the instruction described in #6680 as to how to do the refactoring.
- `declare_clippy_lint!` and `impl LintPass` is placed in `transmute/mod.rs`
- Uitlity functions is placed in `transmute/utils.rs`
- Each lint function about `transmute` is moved into its own module, like `transmute/useless_transmute.rs`
For ease of review, I refactored step by step, keeping each commit small. For instance, all I did in
2451781 was to move `useless_transmute` into its own module.
---
changelog: Refactor `transmute.rs` file into `transmute` module.