Skip to content

Commit

Permalink
Rollup merge of rust-lang#81501 - calebcartwright:update-rustfmt, r=s…
Browse files Browse the repository at this point in the history
…anxiyn

update rustfmt to v1.4.34

Short summary: Various formatting fixes (several const generic related) and introduction of `imports_granularity` config option

Long summary copied from changelog:

#### Changed
- `merge_imports` configuration has been deprecated in favor of the new `imports_granularity` option. Any existing usage of `merge_imports` will be automatically mapped to the corresponding value on `imports_granularity` with a warning message printed to encourage users to update their config files.

#### Added
- New `imports_granularity` option has been added which succeeds `merge_imports`. This new option supports several additional variants which allow users to merge imports at different levels (crate or module), and even flatten imports to have a single use statement per item. ([PR rust-lang/rustfmt#4634](rust-lang/rustfmt#4634), [PR rust-lang/rustfmt#4639](rust-lang/rustfmt#4639))

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

#### Fixed
- Fix erroneous removal of `const` keyword on const trait impl ([rust-lang/rustfmt#4084](rust-lang/rustfmt#4084))
- Fix incorrect span usage wit const generics in supertraits ([rust-lang/rustfmt#4204](rust-lang/rustfmt#4204))
- Use correct span for const generic params ([rust-lang/rustfmt#4263](rust-lang/rustfmt#4263))
- Correct span on const generics to include type bounds ([rust-lang/rustfmt#4310](rust-lang/rustfmt#4310))
- Idempotence issue on blocks containing only empty statements ([rust-lang/rustfmt#4627](rust-lang/rustfmt#4627) and [rust-lang#3868](rust-lang/rustfmt#3868))
- Fix issue with semicolon placement on required functions that have a trailing comment that ends in a line-style comment before the semicolon ([rust-lang/rustfmt#4646](rust-lang/rustfmt#4646))
- Avoid shared interned cfg_if symbol since rustfmt can re-initialize the rustc_ast globals on multiple inputs ([rust-lang/rustfmt#4656](rust-lang/rustfmt#4656))
- Don't insert trailing comma on (base-less) rest in struct literals within macros ([rust-lang/rustfmt#4675](rust-lang/rustfmt#4675))
  • Loading branch information
JohnTitor committed Jan 30, 2021
2 parents 0f11a94 + 63714af commit 6090c57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4442,7 +4442,7 @@ dependencies = [

[[package]]
name = "rustfmt-nightly"
version = "1.4.32"
version = "1.4.34"
dependencies = [
"annotate-snippets 0.6.1",
"anyhow",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt
Submodule rustfmt updated 47 files
+38 −1 CHANGELOG.md
+1 −1 Cargo.lock
+1 −1 Cargo.toml
+60 −2 Configurations.md
+21 −2 src/config/config_type.rs
+70 −2 src/config/mod.rs
+15 −1 src/config/options.rs
+13 −3 src/expr.rs
+122 −33 src/imports.rs
+18 −10 src/items.rs
+1 −0 src/lib.rs
+1 −5 src/modules.rs
+10 −5 src/reorder.rs
+2 −1 src/spanned.rs
+38 −0 src/test/mod.rs
+8 −0 src/utils.rs
+1 −1 tests/source/configs/group_imports/StdExternalCrate-merge_imports.rs
+1 −1 tests/source/configs/imports_layout/merge_mixed.rs
+12 −0 tests/source/const_generics.rs
+8 −0 tests/source/impls.rs
+4 −1 tests/source/imports_granularity_crate.rs
+6 −0 tests/source/imports_granularity_item.rs
+18 −0 tests/source/imports_granularity_module.rs
+1 −1 tests/source/issue-3750.rs
+20 −0 tests/source/issue-4646.rs
+2 −0 tests/source/issue-4656/format_me_please.rs
+7 −0 tests/source/issue-4656/lib.rs
+3 −0 tests/source/issue-4656/lib2.rs
+13 −0 tests/source/issue_3868.rs
+8 −0 tests/source/issue_4675.rs
+4 −0 tests/source/merge_imports_true_compat.rs
+1 −1 tests/target/configs/group_imports/StdExternalCrate-merge_imports.rs
+1 −1 tests/target/configs/imports_layout/merge_mixed.rs
+13 −0 tests/target/const_generics.rs
+8 −0 tests/target/impls.rs
+4 −1 tests/target/imports_granularity_crate.rs
+13 −0 tests/target/imports_granularity_item.rs
+20 −0 tests/target/imports_granularity_module.rs
+1 −1 tests/target/issue-3750.rs
+9 −0 tests/target/issue-4310.rs
+20 −0 tests/target/issue-4646.rs
+1 −0 tests/target/issue-4656/format_me_please.rs
+7 −0 tests/target/issue-4656/lib.rs
+3 −0 tests/target/issue-4656/lib2.rs
+9 −0 tests/target/issue_3868.rs
+8 −0 tests/target/issue_4675.rs
+3 −0 tests/target/merge_imports_true_compat.rs

0 comments on commit 6090c57

Please sign in to comment.