Refactor types lints
Ref #6724.
As described in #6724, `types.rs` contains many groups inside it.
In this PR, I reorganize the lints of the `types` group into their own modules.
changelog: none
Let Cargo track CLIPPY_ARGS
This PR makes `clippy-driver` emit `CLIPPY_ARGS` in its `dep-info` output.
Just like #6441, this allows this workflow to work:
```shell
cargo clippy # warning: empty `loop {}` wastes CPU cycles
cargo clippy -- -A clippy::empty_loop # no warnings emitted
```
But without rebuilding all dependencies.
cc https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/CLIPPY_ARGS.20is.20not.20tracked.20by.20Cargo/near/228599088
changelog: Cargo now re-runs Clippy if arguments after `--` provided to `cargo clippy` are changed.
migrate paths to newly-added diagnostic items
This gets rid of the following paths:
* OS_STRING
* TO_OWNED
* TO_STRING
Removes some usages of:
* PATH_BUF
Per #5393
also removes unneeded `is_ty_param_path` from `clippy_lints::types` and relocates `is_ty_param_lang_item` and `is_ty_param_diagnostic_item` to `clippy_utils`.
changelog: none
This gets rid of the following paths:
* OS_STRING
* TO_OWNED
* TO_STRING
Also removes some usages of:
* PATH_BUF
And the now completely unused `clippy_lints::types::is_ty_param_path`
`len_without_is_empty` will now consider multiple impl blocks
fixes#1562
This also reverts #1559 as the `#[allow]` now works on the `len` method. A note has also been added to point out where the `empty` method is, if it exists.
changelog: `len_without_is_empty` will now consider multiple impl blocks
changelog: `len_without_is_empty` will now consider `#[allow]` on both the `len` method, and the type definition
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`.