Skip to content

Commit 118f935

Browse files
committed
Update use declarations formatting options.
As decided in rust-lang/compiler-team#750. Use declarations are currently wildly inconsistent because rustfmt is quite unopinionated about how they should be formatted. The `rustfmt.toml` additions makes rustfmt more opinionated, which avoids the need for any decision when adding new use declarations to a file. This commit only updates `rustfmt.toml` and `compiler/rustc_codegen_cranelift/rustfmt.toml`. The next commit will do the reformatting.
1 parent 2cbbe8b commit 118f935

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

compiler/rustc_codegen_cranelift/rustfmt.toml

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ ignore = [
66
version = "Two"
77
use_small_heuristics = "Max"
88
merge_derives = false
9+
group_imports = "StdExternalCrate"
10+
imports_granularity = "Module"

rustfmt.toml

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
version = "Two"
33
use_small_heuristics = "Max"
44
merge_derives = false
5+
group_imports = "StdExternalCrate"
6+
imports_granularity = "Module"
57

68
# Files to ignore. Each entry uses gitignore syntax, but `!` prefixes aren't allowed.
79
ignore = [

0 commit comments

Comments
 (0)