-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #125744
Rollup of 7 pull requests #125744
Commits on May 29, 2024
-
Remove path choice from
x fmt
and add--all
option.By default, `x fmt` formats/checks modified files. But it also lets you choose one or more paths instead. This adds significant complexity to `x fmt`. Explicit paths are specified via `WalkBuilder::add` rather than `OverrideBuilder::add`. The `ignore` library is not simple, and predicting the interactions between the two mechanisms is difficult. Here's a particularly interesting case. - You can request a path P that is excluded by the `ignore` list in the `rustfmt.toml`. E.g. `x fmt tests/ui/` or `x fmt tests/ui/bitwise.rs`. - `x fmt` will add P to the walker (via `WalkBuilder::add`), traverse it (paying no attention to the `ignore` list from the `rustfmt.toml` file, due to the different mechanism), and call `rustfmt` on every `.rs` file within it. - `rustfmt` will do nothing to those `.rs` files, because it *also* reads `rustfmt.toml` and sees that they match the `ignore` list! It took me *ages* to debug and understand this behaviour. Not good! `x fmt` even lets you name a path below the current directory. This was intended to let you do things like `x fmt std` that mirror things like `x test std`. This works by looking for `std` and finding `library/std`, and then formatting that. Unfortuantely, this motivating case now gives an error. When support was added in rust-lang#107944, `library/std` was the only directory named `std`. Since then, `tests/ui/std` was added, and so `x fmt std` now gives an error. In general, explicit paths don't seem particularly useful. The only two cases `x fmt` really needs are: - format/check the files I have modified (99% of uses) - format/check all files (While respecting the `ignore` list in `rustfmt.toml`, of course.) So this commit moves to that model. `x fmt` will now give an error if given an explicit path. `x fmt` now also supports a `--all` option. (And running with `GITHUB_ACTIONS=true` also causes everything to be formatted/checked, as before.) Much simpler!
Configuration menu - View commit details
-
Copy full SHA for 5cf198d - Browse repository at this point
Copy the full SHA 5cf198dView commit details -
- Precede them all with `fmt` so it's clear where they are coming from. - Use `error:` and `warning:` when appropriate. - Print warnings to stderr instead of stdout
Configuration menu - View commit details
-
Copy full SHA for e98740a - Browse repository at this point
Copy the full SHA e98740aView commit details -
Currently, `x fmt` can print two lists of files. - The untracked files that are skipped. Always done if within a git repo. - The modified files that are formatted. But if you run with `--all` (or with `GITHUB_ACTIONS=true`) it doesn't print anything about which files are formatted. This commit increases consistency. - The formatted/checked files are now always printed. And it makes it clear why a file was formatted, e.g. with "modified". - It uses the same code for both untracked files and formatted/checked files. This means that now if there are a lot of untracked files just the number will be printed, which is like the old behaviour for modified files. Example output: ``` fmt: skipped 31 untracked files fmt: formatted modified file compiler/rustc_mir_transform/src/instsimplify.rs fmt: formatted modified file compiler/rustc_mir_transform/src/validate.rs fmt: formatted modified file library/core/src/ptr/metadata.rs fmt: formatted modified file src/bootstrap/src/core/build_steps/format.rs ``` or (with `--all`): ``` fmt: checked 3148 files ```
Configuration menu - View commit details
-
Copy full SHA for 3d5d6d2 - Browse repository at this point
Copy the full SHA 3d5d6d2View commit details -
It's a weird name, the `fmt_` prefix seems unnecessary.
Configuration menu - View commit details
-
Copy full SHA for a22cfcc - Browse repository at this point
Copy the full SHA a22cfccView commit details -
Clarify the closure in
rustfmt
.- Avoid calling `try_wait` followed immediately by `wait`. - Make the match exhaustive. - Improve the comment.
Configuration menu - View commit details
-
Copy full SHA for 4dec0a0 - Browse repository at this point
Copy the full SHA 4dec0a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b0e6cb - Browse repository at this point
Copy the full SHA 5b0e6cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for de1d0e0 - Browse repository at this point
Copy the full SHA de1d0e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22953b3 - Browse repository at this point
Copy the full SHA 22953b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0697884 - Browse repository at this point
Copy the full SHA 0697884View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8c8d0db - Browse repository at this point
Copy the full SHA 8c8d0dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 301d722 - Browse repository at this point
Copy the full SHA 301d722View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d63e6b - Browse repository at this point
Copy the full SHA 0d63e6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f11d6f - Browse repository at this point
Copy the full SHA 7f11d6fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c4066d - Browse repository at this point
Copy the full SHA 3c4066dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a9c7e02 - Browse repository at this point
Copy the full SHA a9c7e02View commit details -
Configuration menu - View commit details
-
Copy full SHA for a03ba7f - Browse repository at this point
Copy the full SHA a03ba7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e67eaa - Browse repository at this point
Copy the full SHA 6e67eaaView commit details -
Rollup merge of rust-lang#125653 - GuillaumeGomez:migrate-const-prop-…
…lint, r=jieyouxu Migrate `run-make/const-prop-lint` to `rmake.rs` Part of rust-lang#121876. r? ``@jieyouxu``
Configuration menu - View commit details
-
Copy full SHA for 3b6a3eb - Browse repository at this point
Copy the full SHA 3b6a3ebView commit details -
Rollup merge of rust-lang#125662 - Oneirical:more-tests-again, r=jiey…
…ouxu Rewrite `fpic`, `simple-dylib` and `issue-37893` `run-make` tests in `rmake.rs` or ui test format Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
Configuration menu - View commit details
-
Copy full SHA for c2c8e90 - Browse repository at this point
Copy the full SHA c2c8e90View commit details -
Rollup merge of rust-lang#125699 - nnethercote:streamline-rustfmt, r=…
…GuillaumeGomez Streamline `x fmt` and improve its output - Removes the ability to pass paths to `x fmt`, because it's complicated and not useful, and adds `--all`. - Improves `x fmt` output. - Improves `x fmt`'s internal code. r? ``@GuillaumeGomez``
Configuration menu - View commit details
-
Copy full SHA for c62fa82 - Browse repository at this point
Copy the full SHA c62fa82View commit details -
Rollup merge of rust-lang#125701 - scottmcm:generic-from-raw-parts, r…
…=WaffleLapkin [ACP 362] genericize `ptr::from_raw_parts` This implements rust-lang/libs-team#362 As such, it can partially undo rust-lang#124795 , letting `slice_from_raw_parts` just call `from_raw_parts` again without re-introducing the unnecessary cast to MIR. By doing this it also removes a spurious cast from `str::from_raw_parts`. And I think it does a good job of showing the value of the ACP, since the only thing that needed new turbofishing because of this is inside `ptr::null(_mut)`, but only because `ptr::without_provenance(_mut)` doesn't support pointers to extern types, which it absolutely could (without even changing the implementation).
Configuration menu - View commit details
-
Copy full SHA for 849ccc8 - Browse repository at this point
Copy the full SHA 849ccc8View commit details -
Rollup merge of rust-lang#125723 - GuillaumeGomez:migrate-run-make-cr…
…ate-data-smoke, r=jieyouxu Migrate `run-make/crate-data-smoke` to `rmake.rs` Part of rust-lang#121876. r? ``@jieyouxu``
Configuration menu - View commit details
-
Copy full SHA for a34d0f1 - Browse repository at this point
Copy the full SHA a34d0f1View commit details -
Rollup merge of rust-lang#125733 - compiler-errors:async-fn-assoc-ite…
…m, r=fmease Add lang items for `AsyncFn*`, `Future`, `AsyncFnKindHelper`'s associated types Adds lang items for `AsyncFnOnce::Output`, `AsyncFnOnce::CallOnceFuture`, `AsyncFnMut::CallRefFuture`, and uses them in the new solver. I'm mostly interested in doing this to help accelerate uplifting the new trait solver into a separate crate. The old solver is kind of spaghetti, so I haven't moved that to use these lang items (i.e. it still uses `item_name`-based comparisons). update: Also adds lang items for `Future::Output` and `AsyncFnKindHelper::Upvars`. cc ``@lcnr``
Configuration menu - View commit details
-
Copy full SHA for 1ae1388 - Browse repository at this point
Copy the full SHA 1ae1388View commit details -
Rollup merge of rust-lang#125734 - petrochenkov:macinattr, r=wesleywiser
ast: Revert a breaking attribute visiting order change Fixes rust-lang#124535 Fixes rust-lang#125201
Configuration menu - View commit details
-
Copy full SHA for fdfffc0 - Browse repository at this point
Copy the full SHA fdfffc0View commit details