Skip to content

Fix formatting of comments in empty structs #4875

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
58c63cf
Add support for using qualified paths with structs in expression and …
rylev Dec 10, 2020
1e2258f
Use `AttrVec` for `Arm`, `FieldDef`, and `Variant`
JohnTitor Jun 16, 2021
2608f2c
fix(rustfmt): load nested out-of-line mods correctly
calebcartwright Jun 18, 2021
71f01d1
Delete spaces
Jun 21, 2021
d13020c
Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3
JohnTitor Jun 21, 2021
0b8a26f
Rollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, r=Ma…
JohnTitor Jun 21, 2021
33acc96
Document rustfmt on nightly-rustc
jyn514 Jun 30, 2021
abf449f
Rework SESSION_GLOBALS API to prevent overwriting it
GuillaumeGomez May 5, 2021
277feac
Use LocalExpnId where possible.
cjgillot Jun 25, 2021
bfd479d
Merge pull request #4920 from calebcartwright/subtree-sync
calebcartwright Jul 26, 2021
75765f6
Allow `--edition 2021` to be passed to rustfmt
PatchMixolydic May 22, 2021
1ca3798
Improve pasta copyability of `merge_imports` deprecation message
casey May 10, 2021
486e774
Adjusting help message (#4865)
murchu27 Jun 11, 2021
e634a6f
Updating outdated links (#4869)
murchu27 Jun 16, 2021
b305d62
fix: correct arm leading pipe check (#4880)
calebcartwright Jun 24, 2021
19733f1
Change line endings from CRLF to LF
Jun 25, 2021
2cf280e
docs: clarify match_arm_blocks config documentation
calebcartwright Jul 5, 2021
4c2959f
fix a bunch of clippy warnings
matthiaskrgr Jul 18, 2021
d42be80
chore: disable clippy::matches_like_macro lint
calebcartwright Jul 18, 2021
0832137
fix link in Contributing.md
ebobrow Jul 19, 2021
4236289
chore: bump toolchain
calebcartwright Jul 26, 2021
e4b8714
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-r…
calebcartwright Jul 26, 2021
778f035
ci: remove unnecessary cargo-make install on windows jobs
calebcartwright Jul 27, 2021
e7fa070
fix: make --edition 2021 visible in --help
outloudvi Jul 22, 2021
0b21ea2
Unyeet const param defaults
BoxyUwU Apr 28, 2021
8c52aae
Bump deps
klensy Jun 3, 2021
e9038b8
rfc3052: Remove authors field from Cargo manifests
lf- Jul 27, 2021
8cbee56
ci: functionally delete appveyor
calebcartwright Jul 30, 2021
2323cbc
Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
bors Aug 2, 2021
fefb542
fix: handle GAT types in impls with self bounds
calebcartwright Aug 7, 2021
5d8eb8d
fix: don't drop drop generic args on assoc ty constraints
calebcartwright Aug 8, 2021
1d6002a
Enable triagebot assignment in rustfmt
nipunn1313 Aug 8, 2021
64bf8df
Introduce hir::ExprKind::Let - Take 2
c410-f3r Aug 8, 2021
7769ed0
Document private items for rustfmt
jyn514 Jul 14, 2021
e1dac88
Auto merge of #87119 - jyn514:rustfmt-doc-private, r=Mark-Simulacrum
bors Aug 17, 2021
667a2da
Fix stable toggle on gh pages configuration site
ayazhafiz May 31, 2020
6959d03
Show configs from different versions on github pages
ayazhafiz Jun 1, 2020
916c238
fixup! Show configs from different versions on github pages
ayazhafiz Jun 1, 2020
1045c62
Add github-style highlighting for code blocks (#4224)
ayazhafiz Jun 1, 2020
c5f1d96
Adds direct linking using header ids (#4272)
aszenz Jun 23, 2020
31c97ce
Adds query param for version no (#4270)
aszenz Jun 23, 2020
3195d6c
docs: Preserve updated query param content and add config option links
ayazhafiz Jul 3, 2020
bf47fc1
Ensure that doc url hash IDs are scrolled to on page load
ayazhafiz Jul 16, 2020
f5c782f
fixup! Ensure that doc url hash IDs are scrolled to on page load
ayazhafiz Jul 16, 2020
5c7ac69
Warn when rate limit is on docs page
ayazhafiz Jul 16, 2020
3c36a0c
Exluding v0.8.1 and v0.7 from the config dropdown
jdollar Oct 3, 2020
042c2ec
Added Updated default version to Rustfmt docs config
gunadhya Jan 15, 2021
ec86cfd
Fix redirect issue
gunadhya Jan 21, 2021
f787288
Fix for version config option anchor
davidBar-On Mar 3, 2021
25ebc35
Fix more “a”/“an” typos
steffahn Aug 22, 2021
9bc0dbe
Fix typos “an”→“a” and a few different ones that appeared in the same…
steffahn Aug 22, 2021
c8bd550
Add test for visibility on a trait item (currently wrong)
dtolnay Aug 20, 2021
fd6b025
Preserve visibility on trait items inside trait and impl
dtolnay Aug 20, 2021
e81c393
fix: remove wrong reformatting of qualified paths in struct patterns
ashvin021 Aug 25, 2021
076916f
Introduce `~const`
fee1-dead Aug 25, 2021
20ddab3
Fix rustfmt test
fee1-dead Aug 27, 2021
a603756
Temporary fix rustfmt for let-else
camsteffen Jul 25, 2021
ca9b050
Implement `One` option for imports_granularity (#4669)
magurotuna Jan 30, 2021
c71c68c
Add <title> to docs
akiomik Sep 1, 2021
d19f69c
test: add missing source for #4943
cowboy-bebug Aug 30, 2021
33d1368
test: add test for #4257
cowboy-bebug Aug 30, 2021
bfc6046
test: add test for #4954
cowboy-bebug Aug 30, 2021
ae5696a
test: add test for #4322
cowboy-bebug Aug 30, 2021
48b8e45
Detect bare blocks with type ascription that were meant to be a `stru…
estebank Sep 2, 2021
1674eea
Fix #88256, remove duplicated diagnostic
chenyukang Sep 4, 2021
6271ded
Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebank
bors Sep 6, 2021
59063e8
fix: newline width calc in combine w/ comments (#4123)
calebcartwright Apr 16, 2020
a59cac2
fix: use correct spans for params with attrs
calebcartwright Sep 6, 2021
c2f0e99
try to write the parameter on a new line in case the attribute/parame…
scampi Oct 6, 2020
3d8cd57
tests: add files for issue 4579
calebcartwright Sep 6, 2021
57548aa
fix: resolve idempotency issue in extern body elements
calebcartwright Sep 8, 2021
a806883
fix: handle param doc comments for macro scenarios
calebcartwright Sep 8, 2021
b10ab51
rustfmt doc code blocks with multiple comma-separated attributes
nipunn1313 Aug 8, 2021
d647ebf
Revert "Allow formatting `Anonymous{Struct, Union}` declarations"
pnkfelix Sep 8, 2021
e014277
Ignore automatically derived impls of `Clone` and `Debug` in dead cod…
FabianWolff May 21, 2021
127ec9a
Keep a parent LocalDefId in SpanData.
cjgillot Apr 18, 2021
8743472
Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petr…
bors Sep 11, 2021
67a59f6
opts: rephrase wording for --all and -p
lnicola Nov 8, 2019
d4ffd1e
Support @generated marker to skip code formatting
topecongiro Jul 10, 2020
9d65b7d
feat: upper- or lowercase hexadecimal literals
ArjenL Jul 15, 2021
52e1a52
Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwco
Manishearth Sep 15, 2021
17cb2b1
feat: add --check flag to cargo fmt (#3890)
calebcartwright Oct 27, 2019
7aa69e5
refactor: use iter workaround for contains() gap
calebcartwright Sep 17, 2021
dd445ab
Trailing comma on match block goes missing when guard is on its own line
ulyssa Sep 15, 2021
9060bc5
Migrate to 2021
Mark-Simulacrum Sep 19, 2021
74df7b3
deps: update cargo_metadata to include 'path'
calebcartwright Sep 20, 2021
7f6229b
tests: restructure and extend cargo-fmt tests
calebcartwright Sep 20, 2021
4b9d637
refactor: simplify local dep lookups
calebcartwright Sep 21, 2021
cb144c3
In Configurations.md demonstrate both cases for noop selections
rukai Sep 10, 2021
a5138b3
Prevent removal of qualified path for tuple struct inside macro
ytmimi Sep 27, 2021
e3203ef
Add tests for binop_separator = Back
ulyssa Sep 20, 2021
f0f449d
Wrap long array and slice patterns.
pcwalton Sep 18, 2021
40f4993
Update derive attibute span to start after opening '('
ytmimi Sep 24, 2021
365a2f8
Add additional test cases for issue 4984
ytmimi Sep 29, 2021
8b58cce
Stabilize match_block_trailing_comma. (#4145)
emilio May 16, 2020
d418057
Prevent structs with ".." from being rewritten with alignment
ytmimi Oct 11, 2021
f7c4a44
Adjust non-empty tuple struct span to start before fields
ytmimi Oct 5, 2021
f2fb3c9
Update connector search in ControlFlow::rewrite_pat_expr for for loops
ytmimi Oct 6, 2021
c9c1932
feat: stabilize disable_all_formatting
calebcartwright Oct 14, 2021
0cff306
ci: fix release asset upload job
calebcartwright Oct 14, 2021
5f4811e
Handle DefinitiveListTactic::SpecialMacro when writing pre-comments
ytmimi Oct 14, 2021
1ae5c35
Replace match expression with match! macro
ytmimi Oct 19, 2021
9231263
Merge branch 'master' into 1.4.38-subtree
calebcartwright Oct 20, 2021
5f79583
chore: bump toolchain, fix conflict
calebcartwright Oct 20, 2021
b9178dc
Merge pull request #5036 from calebcartwright/1.4.38-subtree
calebcartwright Oct 20, 2021
efa8f55
chore: bump version and changelog
calebcartwright Oct 20, 2021
2b41b6d
Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-…
calebcartwright Oct 20, 2021
606c7d4
ensure cargo-fmt tests are excluded from root workspace
calebcartwright Oct 20, 2021
051e2b4
fix doc issue in rustfmt
calebcartwright Oct 21, 2021
599b2fd
Add One option to group_imports (#4966)
Heliozoa Oct 23, 2021
757da8c
Merge remote-tracking branch 'upstream/master' into another-subtree-sync
calebcartwright Oct 24, 2021
50369f5
Merge pull request #5043 from calebcartwright/another-subtree-sync
calebcartwright Oct 24, 2021
d454e81
Add rustdoc CI check
ytmimi Oct 23, 2021
c493ee4
fix clippy::needless_borrow
matthiaskrgr Oct 23, 2021
0b8ffac
fix a bunch of the other clippy warnings that look interesting
matthiaskrgr Oct 23, 2021
8b766f3
Remove legacy-rustfmt.toml (#4169)
topecongiro May 11, 2020
bc46af9
Retain trailing comments in module when using rustfmt::skip attribute
ytmimi Oct 19, 2021
ed5a025
refactor: minor parser cleanup
calebcartwright Oct 30, 2021
54b1e0b
README grammar fix (#3926)
enterprisey Nov 14, 2019
a24ed3c
Fix MSRV
Nov 25, 2020
a4d7011
Document RUSTFMT environment variable (#4464)
MonliH Oct 11, 2020
5ce82e1
Prevent trailing whitespace in where clause bound predicate
ytmimi Oct 8, 2021
c1eab15
Use a custom env var for log settings intead of default RUST_LOG
peterjoel Oct 7, 2020
bd86077
Remove grave accent that shouldn't be there
Nov 1, 2021
e75c4d7
ci: drop appveyor
calebcartwright Nov 4, 2021
a5f8505
fix: handle external mods imported via external->inline load hierarchy
calebcartwright Nov 4, 2021
9027db9
Update IntelliJ Integration (#4238)
dima74 Jun 6, 2020
4d50e7c
Put empty trait braces on same line if possible
mujpao Nov 2, 2021
19c5c74
refactor: dedupe & simplify ty alias formatting
calebcartwright Nov 6, 2021
bf3c52f
ast: Fix naming conventions in AST structures
petrochenkov Nov 7, 2021
e4472d3
refactor: dedupe associated item visitation
calebcartwright Nov 6, 2021
4621915
Merge remote-tracking branch 'upstream/master' into rustup-2021-11-s1
calebcartwright Nov 7, 2021
31bc54a
chore: bump toolchain
calebcartwright Nov 8, 2021
ea199ba
Merge pull request #5070 from calebcartwright/rustup-2021-11-s1
calebcartwright Nov 8, 2021
f99e358
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-…
calebcartwright Nov 8, 2021
e6d1bf5
Link tracking issues in Configurations.md (#4096)
Mar 31, 2020
eee8f04
refactor: cleanup duplicative Impl handling code
calebcartwright Nov 17, 2021
0023abf
tests: add cases for type alias issues
calebcartwright Nov 18, 2021
2c442cc
fix: correct some type alias issues
calebcartwright Nov 18, 2021
196e676
Preserve normalized comments after last list item
mujpao Nov 19, 2021
826eba8
Add a few missing tracking issues in Configurations.md (#5084)
karyon Nov 20, 2021
4389a4c
fix: do not wrap reference-style doc links
domodwyer Nov 19, 2021
f99469d
Change how the fn params span is calculated
estebank Nov 24, 2021
243cec7
Update README.md
bluenote10 Nov 24, 2021
ea042b9
Add more tests for comments in lists
mujpao Nov 24, 2021
67fd9ec
Run Windows, Linux, and Mac CI tests with nightly and stable channels
ytmimi Nov 24, 2021
a21f1b6
Conditionally compile tests based on CFG_RELEASE_CHANNEL env var
ytmimi Nov 27, 2021
0fc846f
refactor: maintain more AST info when formatting a RHS
calebcartwright Nov 28, 2021
1f28683
Update nightly only test with #[nightly_only_test] attribute
ytmimi Nov 29, 2021
ec46ffd
Determine when new comment lines are needed for itemized blocks
ytmimi Nov 19, 2021
e305322
Merge remote-tracking branch 'upstream/master' into subtree-sync-2021…
calebcartwright Dec 3, 2021
8da8371
Merge pull request #5121 from calebcartwright/subtree-sync-2021-12-02
calebcartwright Dec 3, 2021
0167c53
Merge commit '8da837185714cefbb261e93e9846afb11c1dc60e' into sync-rus…
calebcartwright Dec 3, 2021
f40b1d9
Backport: Do not touch module with #![rustfmt::skip] (4297)
ytmimi Nov 24, 2021
740fb57
clippy fixes
matthiaskrgr Dec 12, 2021
57ac92b
Prevent duplicate comma when formatting struct pattern with ".."
ytmimi Nov 18, 2021
b4afb38
Remove `SymbolStr`.
nnethercote Dec 14, 2021
3bb5f81
Remove unnecessary sigils around `Symbol::as_str()` calls.
nnethercote Dec 15, 2021
122e1c3
Remove unnecessary sigils around `Ident::as_str()` calls.
nnethercote Dec 15, 2021
8bf82ae
Merge remote-tracking branch 'upstream/master' into subtree-sync-2021…
calebcartwright Dec 19, 2021
b214938
chore: bump toolchain
calebcartwright Dec 20, 2021
0346bc7
Merge pull request #5140 from calebcartwright/subtree-sync-2021-12-19
calebcartwright Dec 20, 2021
40b73d8
refactor: rename syntux mod to parse
calebcartwright Dec 20, 2021
9ce5470
refactor: move macro arg parsing to parse mod
calebcartwright Dec 21, 2021
c8cf454
refactor: move lazy_static parsing to parse mod
calebcartwright Dec 21, 2021
6298756
refactor: extract final rustc_parse touchpoint from macros.rs
calebcartwright Dec 21, 2021
97c3e48
refactor: encapsulate cfg_if parsing within parse mod
calebcartwright Dec 21, 2021
7b8303d
chore: cleanup unused imports
calebcartwright Dec 21, 2021
0b2fd9b
Fix static async closure qualifier order
dtolnay Dec 23, 2021
76eb077
Retain qualified path when rewriting struct literals
ytmimi Dec 24, 2021
e8afb62
chore: reduce some vis. for updated unreachable_pub lint
calebcartwright Dec 27, 2021
50bbb43
chore: bump toolchain
calebcartwright Dec 29, 2021
f935f0c
feat: support parsing asm! args
calebcartwright Dec 29, 2021
4a053f2
Do not flatten match arm block with leading attributes
davidlattimore Dec 29, 2021
737e6f7
Improve out of line module resolution
ytmimi Dec 20, 2021
93b7de5
Make `--check` work when running from stdin. (#3896)
jugglerchris Nov 6, 2019
34263cd
Fix --check -l with stdin. (#3910)
jugglerchris Nov 12, 2019
776baf9
refactor: update json emitter to better handle errors (#3953)
calebcartwright Dec 9, 2019
894a3c0
Fix newlines in JSON output (#4262)
Timmmm Jun 23, 2020
34d374e
Use <stdin> when emitting stdin as filename (#4298)
topecongiro Jul 3, 2020
5056f4c
some minor clippy fixes
matthiaskrgr Jan 5, 2022
a1e4f8e
Fix formatting of comments in empty structs
Szymongib Jan 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
jobs:
test:
runs-on: ubuntu-latest
name: (${{ matrix.target }}, nightly)
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
Expand All @@ -20,6 +22,7 @@ jobs:
target: [
x86_64-unknown-linux-gnu,
]
cfg_release_channel: [nightly, stable]

steps:
- name: checkout
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ jobs:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
# macOS Catalina 10.15
runs-on: macos-latest
name: (${{ matrix.target }}, nightly)
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
fail-fast: false
matrix:
target: [
x86_64-apple-darwin,
]
cfg_release_channel: [nightly, stable]

steps:
- name: checkout
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/rustdoc_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: rustdoc check
on:
push:
branches:
- master
pull_request:

jobs:
rustdoc_check:
runs-on: ubuntu-latest
name: rustdoc check
steps:
- name: checkout
uses: actions/checkout@v2

- name: install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add x86_64-unknown-linux-gnu

- name: document rustfmt
env:
RUSTDOCFLAGS: --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options -Dwarnings
run: cargo doc -Zskip-rustdoc-fingerprint --no-deps -p rustfmt-nightly -p rustfmt-config_proc_macro
29 changes: 15 additions & 14 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: upload

on:
push:
release:
types: [created]
workflow_dispatch:

jobs:
build-release:
Expand All @@ -14,42 +16,40 @@ jobs:
- build: linux-x86_64
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: macos-x86_64
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
- build: windows-x86_64-gnu
os: windows-latest
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
- build: windows-x86_64-msvc
os: windows-latest
rust: nightly-x86_64-msvc
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
# Run build
- name: install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}

- name: Add mingw64 to path for x86_64-gnu
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
if: matrix.rust == 'nightly-x86_64-gnu'
shell: bash

- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --force cargo-make

- name: Build release binaries
uses: actions-rs/cargo@v1
with:
command: make
args: release
command: build
args: --release

- name: Build archive
shell: bash
Expand All @@ -70,6 +70,7 @@ jobs:
fi

- name: Upload Release Asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
jobs:
test:
runs-on: windows-latest
name: (${{ matrix.target }}, nightly)
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
Expand All @@ -23,6 +25,7 @@ jobs:
x86_64-pc-windows-gnu,
x86_64-pc-windows-msvc,
]
cfg_release_channel: [nightly, stable]

steps:
# The Windows runners have autocrlf enabled by default
Expand Down Expand Up @@ -54,9 +57,6 @@ jobs:
if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
shell: bash

- name: cargo-make
run: cargo install --force cargo-make

- name: build
run: |
rustc -Vv
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Generated by Cargo
# will have compiled files and executables
/target
tests/cargo-fmt/**/target

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
Expand Down
77 changes: 72 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,73 @@

## [Unreleased]

## [1.4.38] 2021-10-20

### Changed

- Switched from `rustc-ap-*` crates to `rustc_private` for consumption model of rustc internals
- `annotate-snippets` updated to v0.8 [PR #4762](https://github.com/rust-lang/rustfmt/pull/4762)
- Greatly improved the performance of `cargo fmt` in large workspaces utilizing the `--all` flag by updating to a newer version of `cargo_metadata` that leverages updated `cargo` output from v1.51+ [PR #4997](https://github.com/rust-lang/rustfmt/pull/4997)
- Improved formatting of long slice patterns [#4530](https://github.com/rust-lang/rustfmt/issues/4530)
- **Note you must have `version = Two` in your configuration to take advantage of the new formatting**
- Stabilized `match_block_trailing_comma` configuration option [#3380](https://github.com/rust-lang/rustfmt/issues/3380) - [https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#match_block_trailing_comma](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#match_block_trailing_comma)
- Stabilized `disable_all_formatting` configuration option [#5026](https://github.com/rust-lang/rustfmt/pull/5026) - [https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#disable_all_formatting](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#disable_all_formatting)
- Various improvements to the configuration documentation website [https://rust-lang.github.io/rustfmt/?version=v1.4.38]([https://rust-lang.github.io/rustfmt/?version=v1.4.38])
- Addressed various clippy and rustc warnings


### Fixed

- Resolved issue where specious whitespace would be inserted when a block style comment was terminated within string literal processing [#4312](https://github.com/rust-lang/rustfmt/issues/4312)
- Nested out-of-line mods are again parsed and formatted [#4874](https://github.com/rust-lang/rustfmt/issues/4874)
- Accepts `2021` for edition value from rustfmt command line [PR #4847](https://github.com/rust-lang/rustfmt/pull/4847)
- Unstable command line options are no longer displayed in `--help` text on stable [PR #4798](https://github.com/rust-lang/rustfmt/issues/4798)
- Stopped panicking on patterns in match arms which start with non-ascii characters [#4868](https://github.com/rust-lang/rustfmt/issues/4868)
- Stopped stripping defaults on const params [#4816](https://github.com/rust-lang/rustfmt/issues/4816)
- Fixed issue with dropped content with GAT aliases with self bounds in impls [#4911](https://github.com/rust-lang/rustfmt/issues/4911)
- Stopped removing generic args on associated type constraints [#4943](https://github.com/rust-lang/rustfmt/issues/4943)
- Stopped dropping visibility on certain trait and impl items [#4960](https://github.com/rust-lang/rustfmt/issues/4960)
- Fixed dropping of qualified paths in struct patterns [#4908](https://github.com/rust-lang/rustfmt/issues/4908) and [#5005](https://github.com/rust-lang/rustfmt/issues/5005)
- Fixed bug in line width calculation that was causing specious formatting of certain patterns [#4031](https://github.com/rust-lang/rustfmt/issues/4031)
- **Note that this bug fix may cause observable formatting changes in cases where code had been formatted with prior versions of rustfmt that contained the bug**
- Fixed bug where rustfmt would drop parameter attributes if they were too long in certain cases [#4579](https://github.com/rust-lang/rustfmt/issues/4579)
- Resolved idempotency issue with extern body elements [#4963](https://github.com/rust-lang/rustfmt/issues/4963)
- rustfmt will now handle doc-style comments on function parameters, since they could appear with certain macro usage patterns even though it's generally invalid syntax [#4936](https://github.com/rust-lang/rustfmt/issues/4936)
- Fixed bug in `match_block_trailing_comma` where commas were not added to the blocks of bodies whose arm had a guard that did not fit on the same line as the pattern [#4998](https://github.com/rust-lang/rustfmt/pull/4998)
- Fixed bug in cases where derive attributes started with a block style comment [#4984](https://github.com/rust-lang/rustfmt/issues/4984)
- Fixed issue where the struct rest could be lost when `struct_field_align_threshold` was enabled [#4926](https://github.com/rust-lang/rustfmt/issues/4926)
- Handles cases where certain control flow type expressions have comments between patterns/keywords and the pattern ident contains the keyword [#5009](https://github.com/rust-lang/rustfmt/issues/5009)
- Handles tuple structs that have explicit visibilities and start with a block style comment [#5011](https://github.com/rust-lang/rustfmt/issues/5011)
- Handles leading line-style comments in certain types of macro calls [#4615](https://github.com/rust-lang/rustfmt/issues/4615)


### Added
- Granular width heuristic options made available for user control [PR #4782](https://github.com/rust-lang/rustfmt/pull/4782). This includes the following:
- [`array_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#array_width)
- [`attr_fn_like_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#attr_fn_like_width)
- [`chain_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#chain_width)
- [`fn_call_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#fn_call_width)
- [`single_line_if_else_max_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#single_line_if_else_max_width)
- [`struct_lit_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#struct_lit_width)
- [`struct_variant_width`](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#struct_variant_width)

Note this hit the rustup distributions prior to the v1.4.38 release as part of an out-of-cycle updates, but is listed in this version because the feature was not in the other v1.4.37 releases. See also the `use_small_heuristics` section on the configuration site for more information
[https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#use_small_heuristics](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#use_small_heuristics)

- New `One` variant added to `imports_granularity` configuration option which can be used to reformat all imports into a single use statement [#4669](https://github.com/rust-lang/rustfmt/issues/4669)
- rustfmt will now skip files that are annotated with `@generated` at the top of the file [#3958](https://github.com/rust-lang/rustfmt/issues/3958)
- New configuration option `hex_literal_case` that allows user to control the casing utilized for hex literals [PR #4903](https://github.com/rust-lang/rustfmt/pull/4903)

See the section on the configuration site for more information
https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#hex_literal_case

- `cargo fmt` now directly supports the `--check` flag, which means it's now possible to run `cargo fmt --check` instead of the more verbose `cargo fmt -- --check` [#3888](https://github.com/rust-lang/rustfmt/issues/3888)

### Install/Download Options
- **rustup (nightly)** - *pending*
- **GitHub Release Binaries** - [Release v1.4.38](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.38)
- **Build from source** - [Tag v1.4.38](https://github.com/rust-lang/rustfmt/tree/v1.4.38), see instructions for how to [install rustfmt from source][install-from-source]

## [1.4.37] 2021-04-03

### Changed
Expand Down Expand Up @@ -176,7 +243,7 @@ https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity

### Changed

- Original comment indentation for trailing comments within an `if` is now taken into account when determining the indentation level to use for the trailing comment in formatted code. This does not modify any existing code formatted with rustfmt; it simply gives the programmer discretion to specify whether the comment is associated to the `else` block, or if the trailing comment is just a member of the `if` block. ([#1575](https://github.com/rust-lang/rustfmt/issues/1575), [#4120](https://github.com/rust-lang/rustfmt/issues/4120), [#4506](https://github.com/rust-lang/rustfmt/issues/4506))
- Original comment indentation for trailing comments within an `if` is now taken into account when determining the indentation level to use for the trailing comment in formatted code. This does not modify any existing code formatted with rustfmt; it simply gives the programmer discretion to specify whether the comment is associated to the `else` block, or if the trailing comment is just a member of the `if` block. ([#1575](https://github.com/rust-lang/rustfmt/issues/1575), [#4120](https://github.com/rust-lang/rustfmt/issues/4120), [#4506](https://github.com/rust-lang/rustfmt/issues/4506))

In this example the `// else comment` refers to the `else`:
```rust
Expand Down Expand Up @@ -213,7 +280,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"

### Fixed
- Formatting of empty blocks with attributes which only contained comments is no longer butchered.([#4475](https://github.com/rust-lang/rustfmt/issues/4475), [#4467](https://github.com/rust-lang/rustfmt/issues/4467), [#4452](https://github.com/rust-lang/rustfmt/issues/4452#issuecomment-705886282), [#4522](https://github.com/rust-lang/rustfmt/issues/4522))
- Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872))
- Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872))

### Install/Download Options
- **crates.io package** - *pending*
Expand Down Expand Up @@ -297,7 +364,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"
- Fix aligning comments of different group
- Fix flattening imports with a single `self`.
- Fix removing attributes on function parameters.
- Fix removing `impl` keyword from opaque type.
- Fix removing `impl` keyword from opaque type.

## [1.4.8] 2019-09-08

Expand Down Expand Up @@ -329,7 +396,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"

- Add `--message-format` command line option to `cargo-fmt`.
- Add `-l,--files-with-diff` command line option to `rustfmt`.
- Add `json` emit mode.
- Add `json` emit mode.

### Fixed

Expand Down Expand Up @@ -380,7 +447,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"

### Added

- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt
- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt
from formatting an attribute #3665

### Changed
Expand Down
Loading