mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Merge pull request #1626 from topecongiro/issue-1623
Forbid trailing comma at the end of args of variadic functions
This commit is contained in:
commit
9f96233a35
@ -1944,7 +1944,11 @@ fn rewrite_args(context: &RewriteContext,
|
||||
let fmt = ListFormatting {
|
||||
tactic: tactic,
|
||||
separator: ",",
|
||||
trailing_separator: trailing_comma,
|
||||
trailing_separator: if variadic {
|
||||
SeparatorTactic::Never
|
||||
} else {
|
||||
trailing_comma
|
||||
},
|
||||
shape: Shape::legacy(budget, indent),
|
||||
ends_with_newline: end_with_newline,
|
||||
config: context.config,
|
||||
|
@ -14,3 +14,9 @@ extern "system" {
|
||||
pub fn GetConsoleHistoryInfo(console_history_info: *mut ConsoleHistoryInfo) -> Boooooooooooooool;
|
||||
}
|
||||
|
||||
// rustfmt should not add trailing comma for variadic function. See #1623.
|
||||
extern "C" {
|
||||
pub fn variadic_fn(first_parameter: FirstParameterType,
|
||||
second_parameter: SecondParameterType,
|
||||
...);
|
||||
}
|
||||
|
@ -23,3 +23,12 @@ extern "system" {
|
||||
console_history_info: *mut ConsoleHistoryInfo,
|
||||
) -> Boooooooooooooool;
|
||||
}
|
||||
|
||||
// rustfmt should not add trailing comma for variadic function. See #1623.
|
||||
extern "C" {
|
||||
pub fn variadic_fn(
|
||||
first_parameter: FirstParameterType,
|
||||
second_parameter: SecondParameterType,
|
||||
...
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user