Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7c0f59b

Browse files
authored
Merge pull request rust-lang#3306 from topecongiro/issue-2841
Do not force trailing comma when using mixed layout
2 parents 923da60 + 154ccf6 commit 7c0f59b

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/overflow.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,6 @@ impl<'a> Context<'a> {
607607
tactic
608608
} else if !self.context.use_block_indent() {
609609
SeparatorTactic::Never
610-
} else if tactic == DefinitiveListTactic::Mixed {
611-
// We are using mixed layout because everything did not fit within a single line.
612-
SeparatorTactic::Always
613610
} else {
614611
self.context.config.trailing_comma()
615612
};

tests/source/trailing-comma-never.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ enum StructY {
3939
i: i32,
4040
}
4141
}
42+
43+
static XXX: [i8; 64] = [
44+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1,
45+
];

tests/target/trailing-comma-never.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ enum StructY {
2929
A { s: u16 },
3030
B { u: u32, i: i32 }
3131
}
32+
33+
static XXX: [i8; 64] = [
34+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
35+
];

0 commit comments

Comments
 (0)