Commit 4720773
committed
Merge remote-tracking branch 'upstream/main' into subtree-push-nightly-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
#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`.File tree
238 files changed
+5075
-836
lines changed- .github/workflows
- check_diff
- src
- tests
- ci
- docs
- src
- bin
- cargo-fmt
- config
- emitter
- modules
- parse/macros
- test
- tests
- rustfmt
- source
- cfg_match
- configs
- float_literal_trailing_zero
- match_arm_indent
- issue-3278
- issue-6202
- long-fn-1
- reorder_modules
- A2
- ABCD
- ZYXW_
- ZYXW
- ZY_XW
- Z_YXW
- _ZYXW
- _abcd
- a1
- abcd
- u128
- u16
- u256
- u32
- u64
- u8
- u_zzz
- ua
- usize
- uz
- v000
- v001
- v009
- v00t
- v00
- v010
- v01
- v09
- v0s
- v0u
- v0
- v10
- v1
- v9
- w005s09t
- w5s009t
- x64
- x86_128
- x86_32
- x86_64
- x86
- x87
- zyxw
- target
- cfg_match
- configs
- float_literal_trailing_zero
- match_arm_indent
- issue-3278
- issue-5244
- issue-6202
- long-fn-1
- reorder_modules
- A2
- ABCD
- ZYXW_
- ZYXW
- ZY_XW
- Z_YXW
- _ZYXW
- _abcd
- a1
- abcd
- u128
- u16
- u256
- u32
- u64
- u8
- u_zzz
- ua
- usize
- uz
- v000
- v001
- v009
- v00t
- v00
- v010
- v01
- v09
- v0s
- v0u
- v0
- v10
- v1
- v9
- w005s09t
- w5s009t
- x64
- x86_128
- x86_32
- x86_64
- x86
- x87
- zyxw
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
238 files changed
+5075
-836
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
3 | 36 | | |
4 | 37 | | |
5 | 38 | | |
| |||
39 | 72 | | |
40 | 73 | | |
41 | 74 | | |
42 | | - | |
| 75 | + | |
43 | 76 | | |
44 | 77 | | |
45 | 78 | | |
| |||
133 | 166 | | |
134 | 167 | | |
135 | 168 | | |
136 | | - | |
| 169 | + | |
137 | 170 | | |
138 | 171 | | |
139 | 172 | | |
| |||
298 | 331 | | |
299 | 332 | | |
300 | 333 | | |
301 | | - | |
| 334 | + | |
302 | 335 | | |
303 | 336 | | |
304 | 337 | | |
| |||
0 commit comments