Add clippy and fix commands to x.py
Since they are kind of similar in nature, I have used the same approach as for `cargo check`. At least some of the boilerplate could probably be shared, but I'd prefer to gather some feedback before I decide to merge them more aggressively.
This works reasonably well for `clippy`; with `-A clippy::all` and some extra `#![feature(rustc_private)]`s almost the whole codebase can be processed. There are some concerns, though:
- unlike `check`, in order to be able to traverse all the crates, some of them need to be marked with the `#![feature(rustc_private)]` attribute
- `-W clippy::all` breaks on any error. Is there a way to produce errors but not have them break the progress?
- I'm not sure how to redirect the errors in a way that would show colors; for now I was able to de-jsonize and print them (something not needed for `check`)
`cargo fix` is much more stubborn; it refuses to acknowledge crates like `core` and `std`, so it doesn't progress much at all.
Since this is a bit more tricky than I have envisioned, I need some guidance:
- is this the right approach or am I doing something very wrong ^^?
- why are the extra `rustc_private` features necessary? I was hoping for the same treatment as `check`
- are changes in `clippy` and `cargo fix` needed e.g. in order to produce errors in the same manner as `check` or did I miss something?
- do we need this level of file granularity (e.g. for futureproofing) or can `check`, `clippy` and `fix` files be condensed?
Hopes-to-fix: https://github.com/rust-lang/rust/issues/53896
Cc @alexcrichton, @zackmdavis
Rollup of 13 pull requests
Successful merges:
- #61026 (Tweak macro parse errors when reaching EOF during macro call parse)
- #61095 (Update cargo)
- #61096 (tidy: don't short-circuit on license error)
- #61107 (Fix a couple docs typos)
- #61110 (Revert edition-guide toolstate override)
- #61111 (Fixed type-alias-bounds lint doc)
- #61113 (Deprecate `FnBox`. `Box<dyn FnOnce()>` can be called directly, since 1.35)
- #61116 (Remove the incorrect warning from README.md)
- #61118 (Dont ICE on an attempt to use GAT without feature gate)
- #61121 (improve debug-printing of scalars)
- #61125 (Updated my mailmap entry)
- #61134 (Annotate each `reverse_bits` with `#[must_use]`)
- #61138 (Move async/await tests to their own folder)
Failed merges:
r? @ghost
Move async/await tests to their own folder
This moves run-pass and ui async/await tests to their own folder `src/test/ui/async-await` and organises some into subfolders. (It does not move rustdoc tests for async/await.)
I also did some drive-by cleaning up of issues/error code tests into their own folders (which already existed). These are in separate commits, so easy to separate out if that's more desirable.
r? @cramertj
tidy: don't short-circuit on license error
If there is more than one license error, tidy would only print the first
error. This changes it so that all license errors are printed.