Skip to content
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

Sync rustfmt subtree #98040

Merged
merged 58 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8211d64
Merge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rus…
calebcartwright Mar 30, 2022
1dcdfb2
fix(rustfmt): fix struct field formatting with doc comments present (…
tharun208 Apr 2, 2022
6c6ebec
Create 2024 edition
jhpratt Feb 28, 2022
7d6ca7c
Bump deps (#5237)
light4 Apr 2, 2022
11d0bae
span: move `MultiSpan`
davidtwco Mar 24, 2022
6eea2a8
errors: implement fallback diagnostic translation
davidtwco Mar 26, 2022
f8ad4b5
errors: implement sysroot/testing bundle loading
davidtwco Mar 28, 2022
b482bee
session: opt for enabling directionality markers
davidtwco Apr 3, 2022
91995b6
Replace `structopt` dependency by `clap`
Expyron Apr 7, 2022
2d9bc46
Backport 4326
calebcartwright Jul 14, 2020
4f3f87f
group_imports: test and document non-consecutive imports
tommilligan Mar 5, 2022
0cf62ae
errors: lazily load fallback fluent bundle
davidtwco Apr 12, 2022
a11c79b
Rollup merge of #94461 - jhpratt:2024-edition, r=pnkfelix
Dylan-DPC Apr 15, 2022
10954cf
Visit generics inside visit_fn.
cjgillot Nov 19, 2021
ba0351a
Preserve attributes for `imports_granularity=Item`
narpfel Oct 17, 2021
9b1b3d6
[review] rename internal function
tommilligan Apr 16, 2022
acdab00
[review] check interaction with import grouping
tommilligan Apr 16, 2022
a37d3ab
Memoize format_expr
HKalbasi Dec 15, 2021
e08df2d
Avoid producing `NoDelim` values in `MacArgs::delim()`.
nnethercote Apr 26, 2022
f300792
Make explicit an unreachable `NoDelim` case in `rustfmt`.
nnethercote Apr 26, 2022
70067e3
rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter`
petrochenkov Apr 26, 2022
b26c86b
Update GitHub Actions actions/checkout@v2 to v3
dtolnay Apr 30, 2022
050978b
Fix the rustfmt build
scottmcm Apr 25, 2022
c03e184
fix some typos
cuishuang May 7, 2022
3cc1f5e
Add tests for issue 4573
ytmimi Apr 29, 2022
c65ba14
Fixes #5260
PSeitz Mar 13, 2022
84fd4cd
Update CHANGELOG.md
PSeitz May 9, 2022
17003ce
In the docs for `hex_literal_case`, show the default as a possible value
joshtriplett May 10, 2022
77f0964
Remove some unnecessary invisible delimiter checks.
nnethercote May 11, 2022
8fcf113
Rollup merge of #96543 - nnethercote:rm-make_token_stream-hacks, r=Aa…
JohnTitor May 11, 2022
f77fd90
ast: Introduce some traits to get AST node properties generically
petrochenkov May 1, 2022
8a4c058
Use the traits added to the Rust 2021 Edition prelude
koic May 11, 2022
b08b2da
Add test for issue 3937
ytmimi Mar 31, 2022
b507c60
fix rustfmt
klensy May 18, 2022
9583783
import_granularity: Don't normalize imports with comments
davidlattimore Apr 30, 2022
86940d2
Fix typo
ydah May 20, 2022
241a6f6
Remove `crate` visibility modifier in libs, tests
jhpratt May 21, 2022
0d27f70
Remove feature: `crate` visibility modifier
jhpratt May 21, 2022
9b697d0
Merge crate and restricted visibilities
jhpratt May 21, 2022
0b6659c
Update Configurations.md
pozdneev May 22, 2022
37b48ca
Update Configurations.md
pozdneev May 23, 2022
a5cfd4d
Updated Unreleased CHANGELOG entries
ytmimi Apr 9, 2022
73be264
Rephrase changelog entries to give more context
ytmimi May 26, 2022
3e38399
docs: clarify imports_granularity behavior with comments
calebcartwright May 27, 2022
4c8db85
feat: remove report_todo option
calebcartwright May 30, 2022
825561d
feat: remove report_fixme option
calebcartwright May 30, 2022
5e42967
refactor: remove code for bad issue (e.g. todo/fixme) reporting
calebcartwright May 30, 2022
79515f1
feat: remove license_template_path config option
calebcartwright May 30, 2022
64f1f57
fix: handle inner ignore attribute on stdin
calebcartwright Jun 4, 2022
1ac2ac0
Merge remote-tracking branch 'upstream/master' into subtree-sync-2022…
calebcartwright Jun 8, 2022
aedb396
chore: bump toolchain
calebcartwright Jun 8, 2022
75786fb
Merge pull request #5374 from calebcartwright/subtree-sync-2022-06-07
calebcartwright Jun 9, 2022
5fa2727
Remove useless conditional compilation
Urgau Jun 8, 2022
7d34cfa
Dedup `imports_granularity = "Item"` (#4737)
davidBar-On Mar 16, 2021
7b73b60
chore: prep v1.5.0 release
calebcartwright Jun 13, 2022
ecddc26
Merge commit '7b73b60faca71d01d900e49831fcb84553e93019' into sync-rus…
calebcartwright Jun 13, 2022
f367f4d
update rustfmt version
calebcartwright Jun 13, 2022
3733e45
deps: add clap to workspace hack
calebcartwright Jun 13, 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
104 changes: 42 additions & 62 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ name = "annotate-snippets"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d78ea013094e5ea606b1c05fe35f1dd7ea1eb1ea259908d040b25bd5ec677ee5"

[[package]]
name = "annotate-snippets"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36"
dependencies = [
"unicode-width",
"yansi-term",
]

Expand Down Expand Up @@ -614,6 +621,7 @@ checksum = "6d76c22c9b9b215eeb8d016ad3a90417bd13cb24cf8142756e6472445876cab7"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"indexmap",
"lazy_static",
"os_str_bytes",
Expand All @@ -631,6 +639,19 @@ dependencies = [
"clap 3.1.1",
]

[[package]]
name = "clap_derive"
version = "3.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c"
dependencies = [
"heck 0.4.0",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "clippy"
version = "0.1.63"
Expand Down Expand Up @@ -1099,11 +1120,10 @@ dependencies = [

[[package]]
name = "dirs"
version = "2.0.2"
version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059"
dependencies = [
"cfg-if 0.1.10",
"dirs-sys",
]

Expand Down Expand Up @@ -1219,19 +1239,6 @@ dependencies = [
"termcolor",
]

[[package]]
name = "env_logger"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
dependencies = [
"atty",
"humantime 2.0.1",
"log",
"regex",
"termcolor",
]

[[package]]
name = "env_logger"
version = "0.9.0"
Expand Down Expand Up @@ -1708,6 +1715,12 @@ dependencies = [
"unicode-segmentation",
]

[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"

[[package]]
name = "hermit-abi"
version = "0.1.19"
Expand Down Expand Up @@ -3290,7 +3303,7 @@ dependencies = [
"difference",
"env_logger 0.9.0",
"futures 0.3.19",
"heck",
"heck 0.3.1",
"home",
"itertools",
"jsonrpc-core",
Expand Down Expand Up @@ -3499,6 +3512,7 @@ version = "1.0.0"
dependencies = [
"bstr",
"byteorder",
"clap 3.1.1",
"crossbeam-utils",
"libc",
"libz-sys",
Expand Down Expand Up @@ -3833,7 +3847,7 @@ dependencies = [
name = "rustc_errors"
version = "0.0.0"
dependencies = [
"annotate-snippets",
"annotate-snippets 0.8.0",
"atty",
"rustc_data_structures",
"rustc_error_messages",
Expand Down Expand Up @@ -4084,7 +4098,7 @@ dependencies = [
name = "rustc_macros"
version = "0.1.0"
dependencies = [
"annotate-snippets",
"annotate-snippets 0.8.0",
"fluent-bundle",
"fluent-syntax",
"proc-macro2",
Expand Down Expand Up @@ -4671,16 +4685,17 @@ dependencies = [

[[package]]
name = "rustfmt-nightly"
version = "1.4.38"
version = "1.5.0"
dependencies = [
"annotate-snippets",
"annotate-snippets 0.9.1",
"anyhow",
"bytecount",
"cargo_metadata",
"clap 3.1.1",
"derive-new",
"diff",
"dirs",
"env_logger 0.8.4",
"env_logger 0.9.0",
"getopts",
"ignore",
"itertools",
Expand All @@ -4691,8 +4706,7 @@ dependencies = [
"rustfmt-config_proc_macro",
"serde",
"serde_json",
"structopt",
"term 0.6.1",
"term",
"thiserror",
"toml",
"unicode-segmentation",
Expand Down Expand Up @@ -5080,30 +5094,6 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"

[[package]]
name = "structopt"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c"
dependencies = [
"clap 2.34.0",
"lazy_static",
"structopt-derive",
]

[[package]]
name = "structopt-derive"
version = "0.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "strum"
version = "0.18.0"
Expand All @@ -5116,7 +5106,7 @@ version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c"
dependencies = [
"heck",
"heck 0.3.1",
"proc-macro2",
"quote",
"syn",
Expand Down Expand Up @@ -5196,16 +5186,6 @@ dependencies = [
"utf-8",
]

[[package]]
name = "term"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5"
dependencies = [
"dirs",
"winapi",
]

[[package]]
name = "term"
version = "0.7.0"
Expand Down Expand Up @@ -5260,7 +5240,7 @@ dependencies = [
"getopts",
"libc",
"num_cpus",
"term 0.7.0",
"term",
]

[[package]]
Expand Down Expand Up @@ -5689,9 +5669,9 @@ dependencies = [

[[package]]
name = "unicode-segmentation"
version = "1.6.0"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99"

[[package]]
name = "unicode-width"
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustc-workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ features = [
[dependencies]
bstr = { version = "0.2.13", features = ["default"] }
byteorder = { version = "1", features = ['default', 'std'] }
clap = { version = "3.1.1", features = ["lazy_static", "derive", "clap_derive"]}
curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true }
crossbeam-utils = { version = "0.8.0", features = ["nightly"] }
libc = { version = "0.2.79", features = ["align"] }
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/.github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Run build
- name: install rustup
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/.github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Run build
- name: install rustup
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/.github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Run build
- name: install rustup
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/.github/workflows/rustdoc_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: rustdoc check
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: install rustup
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/.github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Run build
- name: install rustup
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/.github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: disable git eol translation
run: git config --global core.autocrlf false
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Run build
- name: Install Rustup using win.rustup.rs
Expand Down
77 changes: 75 additions & 2 deletions src/tools/rustfmt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,82 @@

## [Unreleased]

### Fixed
## [1.5.0] 2022-06-13

### Changed

- Simplify the rustfmt help text by eliding the full path to the rustfmt binary path from the usage string when running `rustfmt --help` [#5214](https://github.com/rust-lang/rustfmt/issues/5214)

### Fixed

- Remove duplicate imports when `imports_granularity` is set to `Item` [#4725](https://github.com/rust-lang/rustfmt/issues/4725)
- Properly handle stdin input containing an inner skip attribute [#5368](https://github.com/rust-lang/rustfmt/issues/5368)
- Maintain attributes on imports when `imports_granularity` is set to `Item` [#5030](https://github.com/rust-lang/rustfmt/issues/5030)
- Format empty trait definitions as a single line when both `empty_item_single_line` is enabled and `brace_style` is set to `AlwaysNextLine` [#5047](https://github.com/rust-lang/rustfmt/issues/5047)
- Don't change granularity of imports containing comments with `imports_granularity` if doing so could lose or misplace those comments [#5311](https://github.com/rust-lang/rustfmt/pull/5311)
- Prevent rustfmt from removing trailing comments at the end of files annotated with inner `#![rustfmt::skip]` attributes [#5033](https://github.com/rust-lang/rustfmt/issues/5033)
- Fixed various `error[internal]: left behind trailing whitespace"` issues:
- Remove trailing whitespace when formatting a where clause who's bounds have an empty right hand side [#5012](https://github.com/rust-lang/rustfmt/issues/5012) [#4850](https://github.com/rust-lang/rustfmt/issues/4850)
- Prevent rustfmt from adding an empty comment line when rewriting markdown lists at the start of doc comments. This issue was triggered when `wrap_comments=true` [#5088](https://github.com/rust-lang/rustfmt/issues/5088)
- Prevent adding a block indented newline before a function parameter with a complex type that was formatted over multiple lines [#5125](https://github.com/rust-lang/rustfmt/issues/5125)
- Fix various module resolution issues preventing rustfmt from finding modules that should be formatted:
- Handle external mods imported via external->inline load hierarchy [#5063](https://github.com/rust-lang/rustfmt/issues/5063)
- Resolve sub modules of integration tests [#5119](https://github.com/rust-lang/rustfmt/issues/5119)
- Module resolution will fallback to the current search directory if a relative directory search results in a `FileNotFound` error [#5198](https://github.com/rust-lang/rustfmt/issues/5198)
- Give users a clearer error message when resolving a module who's file path is ambiguous (e.g `x.rs` and `x/mod.rs`). Before users were given a `File not found` error message which was confusing [#5167](https://github.com/rust-lang/rustfmt/issues/5167)
- Fix various issues related to type aliases:
- Prevent rustfmt from adding `= impl` to associated types defined in macro bodies [#4823](https://github.com/rust-lang/rustfmt/issues/4823)
- Properly block indent type alias impl traits (TAITs) that wrap to the next line when `version=Two` is set. Before any trait bounds that wrapped to the next line would not be indented [#5027](https://github.com/rust-lang/rustfmt/issues/5027)
- Prevent rustfmt from adding an `impl Trait` definition into types [#5086](https://github.com/rust-lang/rustfmt/issues/5086)
- Fix cases where `normalize_comments=true` would de-normalizes some comments by changing inline comments into block comments [#4909](https://github.com/rust-lang/rustfmt/issues/4909)
- Prevent rustfmt from wrapping the content of markdown [reference-style links](https://www.markdownguide.org/basic-syntax/#reference-style-links) in doc comments [#5095](https://github.com/rust-lang/rustfmt/issues/5095) [#4933](https://github.com/rust-lang/rustfmt/issues/4933)
- Don't format files annotated with inner `#![rustfmt::skip]` attribute [PR #5094](https://github.com/rust-lang/rustfmt/pull/5094)
- Prevent duplicate comma when struct pattern ends with `..` and `trailing_comma=Always`. For example, `let Foo { a, .. } = b;` would become `let Foo { a,, .. } = b;` [#5066](https://github.com/rust-lang/rustfmt/issues/5066)
- Fix the order of `static` and `async` keywords when rewriting static async closures. The correct order is `static` and then `async` (e.g `static async || {}`) [#5149](https://github.com/rust-lang/rustfmt/issues/5149)
- Retain the fully qualified path segment when rewriting struct literals in expression position. Now `<Struct as Trait>::Type` is not rewritten as `Trait::Type` [#5151](https://github.com/rust-lang/rustfmt/issues/5151)
- Do not remove match arm braces from a match arm with a single `ast::ExprKind::Block` that has leading attributes. Removing the braces could lead to code that does not compile. Now rustfmt will leave the outer `{}` in place when formatting `=> {#[allow(unsafe_code)]unsafe {}}` [#4109](https://github.com/rust-lang/rustfmt/issues/4109)
- Backport json emitter and stdin changes [PR #5054](https://github.com/rust-lang/rustfmt/pull/5054)
- Make `--check` work when running rustfmt with input from stdin [PR #3896](https://github.com/rust-lang/rustfmt/pull/3896)
- Fix `--check` with the `--files-with-diff` flag [PR #3910](https://github.com/rust-lang/rustfmt/pull/3910)
- Produce valid JSON when using the JSON emitter [PR #3953](https://github.com/rust-lang/rustfmt/pull/3953)
- Fix newlines in JSON output [PR #4262](https://github.com/rust-lang/rustfmt/pull/4262)
- Use `<stdin>` when emitting stdin as filename [PR #4298](https://github.com/rust-lang/rustfmt/pull/4298)
- Always generate some output when formatting `@generated` files via stdin even when `format_generated_files=false`. Not producing output caused rust-analyzer to delete the file content [rust-lang/rust-analyzer](https://github.com/rust-lang/rust-analyzer/issues/11285) [#5172](https://github.com/rust-lang/rustfmt/issues/5172)
- Properly block indent multi-line comments in empty struct definitions. Previously, only the first comment line would be block indented. All other comment lines would be aligned with the struct definition [#4854](https://github.com/rust-lang/rustfmt/issues/4854)
- Prevent rustfmt from wrapping a comment at a byte position inside a non-ascii character when `wrap_comments=true`. This prevents rustfmt from panicking when breaking on the invalid position [#5023](https://github.com/rust-lang/rustfmt/issues/5023)
- Prevent rustfmt from removing commented out trailing separators (e.g commas) when rewriting lists. For example, remove the comma from a comment like this `// ...,` would lead to a scenario where the entire list could not be rewritten because the content of the comment changed [#5042](https://github.com/rust-lang/rustfmt/issues/5042)
- Fix panic when `import_granularity` was set to `Module`, `One`, or `Crate` and the import use declaration contained an alias `use crate a::b as b1` [#5131](https://github.com/rust-lang/rustfmt/issues/5131)
- Add a newline between generic parameters and their doc comments to prevent the generic parameters from being merged into their doc comments [#5122](https://github.com/rust-lang/rustfmt/issues/5122)
- Fixes indentation issue where string literals manually broken with line continuation characters (`\`) would be incorrectly indented in macro definitions when setting `format_strings=true`[#4036](https://github.com/rust-lang/rustfmt/issues/4036)
- Properly wrap and format long markdown block quotes when `wrap_comments=true` [#5157](https://github.com/rust-lang/rustfmt/issues/5157)
- Prevent rustfmt from wrapping markdown headers even when `wrap_comments=true`. Wrapping the markdown headers would prevent them from being properly rendered with rustdoc [#5238](https://github.com/rust-lang/rustfmt/issues/5238)
- Prevent rustfmt from removing commas between struct fields when those fields were also separated by an empty line [#4791](https://github.com/rust-lang/rustfmt/issues/4791) [#4928](https://github.com/rust-lang/rustfmt/issues/4928)
- Fix compiler error caused when formatting imports with `imports_granularity=Module` and a path containing `self`. Given the following import `use crate::lexer::{self, tokens::TokenData};`, rustfmt would transform the `self` import into `use crate::lexer::self;`. Now rustfmt produces `use crate::lexer::{self};` [#4681](https://github.com/rust-lang/rustfmt/issues/4681)
- Prevent rustfmt from breaking long type links in doc comments on namespace qualifiers (`::`) when `wrap_comments=true`. Breaking these long type links over multiple lines prevented them from being properly rendered in rustdoc [#5260](https://github.com/rust-lang/rustfmt/issues/5260)
- Correctly find the start of struct bodies after any generic `const` parameters. Naively searching for an opening `{` lead to issues since generic `const` parameters are also defined with `{}` (e.g. `struct Example<const N: usize = { 1048576 }> {}`) [#5273](https://github.com/rust-lang/rustfmt/issues/5273)
- Prevent rustfmt from merging derives when using inner or outer `rustfmt::skip::attributes` attributes. For example, `#[rustfmt::skip::attributes(derive)]` [#5270](https://github.com/rust-lang/rustfmt/issues/5270)
- Retain trailing `;` when rewriting macro calls in extern blocks. For example, `extern "C" { x!(-); }`[#5281](https://github.com/rust-lang/rustfmt/issues/5281)
- Add a newline when formatting struct fields preceded by both doc comments and inline comments to prevent the field from being merged into the inline comment. This was not an issue when a struct was preceded by just a doc comment or just an inline comment [#5215](https://github.com/rust-lang/rustfmt/issues/5215)

### Added

- Added `One` as a new [group_imports](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#group_imports) option to create a single group for all imports [PR #4966](https://github.com/rust-lang/rustfmt/pull/4966)
- Add [short_array_element_width_threshold](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#short_array_element_width_threshold) config option to give users more control over when `Mixed` list formatting is used [PR #5228](https://github.com/rust-lang/rustfmt/pull/5228)

- Fixes issue where wrapped strings would be incorrectly indented in macro defs when `format_strings` was enabled [#4036](https://github.com/rust-lang/rustfmt/issues/4036)
### Removed

- Removed unstable, nightly-only config option `report_todo` [#5101](https://github.com/rust-lang/rustfmt/issues/5101)
- Removed unstable, nightly-only config option `report_fixme` [#5102](https://github.com/rust-lang/rustfmt/issues/5102)
- Removed unstable, nightly-only config option `license_template_path` [#5103](https://github.com/rust-lang/rustfmt/issues/5103)

### Misc

- Improved performance when formatting large and deeply nested expression trees, often found in generated code, which have many expressions that exceed `max_width` [#5128](https://github.com/rust-lang/rustfmt/issues/5128), [#4867](https://github.com/rust-lang/rustfmt/issues/4867), [#4476](https://github.com/rust-lang/rustfmt/issues/4476), [#5139](https://github.com/rust-lang/rustfmt/pull/5139)

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

## [1.4.38] 2021-10-20

Expand Down
Loading