Merged
Conversation
Manishearth
approved these changes
Oct 11, 2025
Contributor
|
FYI this was added to eventually support |
Member
|
I think it's small enough that we can dredge it up from the history if we need. |
Contributor
Author
Since there’s no concrete implementation at the moment, we can revert it when we introduce the actual implementation in the future. |
Contributor
|
That's fine with me. I'm just giving you guys context for why it's there. |
Member
|
Got it, thanks! |
jieyouxu
added a commit
to jieyouxu/rustfmt
that referenced
this pull request
Dec 7, 2025
…y-2025-12-06 Note that this merge conflict only makes `rustfmt` **buildable**, some tests (such as idempotency!) are still failing! # Merge conflict resolution - Manually retained `src/parse/macros/asm.rs` (upstream change is rust-lang/rust#140367, local removal was rust-lang#6698). - Several divergences between the `Option<String>` `rust-lang/rust` copy is stuck on, versus the `RewriteResult`s in `rustfmt` tree. When this happens, I changed the signature to use `RewriteResult` to match `rustfmt` tree. - Changed some helpers e.g. `offset_left` to `offset_left_opt`, while for others I had to add spans in places. Whenever this is needed, I take the `rustfmt` version as the "ground truth" and tried to keep close to `rustfmt`s version as much as possible. - There's a few place that I had to add `.unknown_error()` to to convert between missing snippets' `Option<usize>` to `RewriteResult` to match `rustfmt` tree's version. - Removed a few `.()`s to match `rustfmt` tree's version. - Changed a few `.rewrite()` to `.rewrite_result()`. - Changed a few `return None;` -> `Err(RewriteError::Unknown);`. - `format_trait_alias` is a bit non-trivial, the signature diverges. I modified the signature and body to match the `rustfmt` tree's version, because the rust copy's signature obviously does not have sufficient span info for rustfmt to work with. However, I also had to kinda mix-and-match, because the `rustfmt` tree's version did not have const formatting. - I had to improvise here and added a `constness: &ast::Const` parameter. - Please review carefully, this diverges from *both* copies! - Fixed a trivial conflict from removal of AST `P<>` (`item.into_inner()` -> `*item`). - Fixed removal of `TokenKind::{OpenDelim,CloseDelim}` with `TokenKind:: {OpenBrace,CloseBrace}` directly. - Changed `FmtVisitor::with_context` to the `rustfmt` version where `RewriteResult` is expected of the closure return. Also modified some `rw` -> `rw.ok()` to match `rustfmt`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It has been marked with
#[allow(dead_code)]for four years, and since it’s no longer used, we should remove it.