In rust-lang/style-team#201 (comment), the style team FCPed a decision about how to format code within cfg_select. This included by reference the determination made in #144323 (comment). In that, we specified the following formatting:
cfg_select! {
feature
= "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff"
=> {
println!();
}
feature
= "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff"
=> {}
anything(
"some other long long long long long thing long long long long long long long long long long long",
) => {}
}
That PR was closed, and formatting for cfg_select! landed in #154202 (thanks for that!). But the current formatting, for the above, on nightly, is:
cfg_select! {
feature = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff" =>
{
println!();
}
feature = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff" =>
{}
anything(
"some other long long long long long thing long long long long long long long long long long long",
) => {}
}
It's also not adding trailing commas, so it formats this —
cfg_select! {
all(target_arch = "x86_64", target_env = "gnu", not(any(target_os = "os1", target_os = "os2"))) => {}
any(one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen) => {}
_ => {}
}
— as:
cfg_select! {
all(
target_arch = "x86_64",
target_env = "gnu",
not(any(target_os = "os1", target_os = "os2"))
) => {}
any(
one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen,
fourteen, fifteen, sixteen
) => {}
_ => {}
}
I'd suspect we might want it to add the trailing commas there.
@ytmimi: What are you thoughts on how to handle this given the pending beta bump?
cc @rust-lang/rustfmt @rust-lang/style
In rust-lang/style-team#201 (comment), the style team FCPed a decision about how to format code within
cfg_select. This included by reference the determination made in #144323 (comment). In that, we specified the following formatting:That PR was closed, and formatting for
cfg_select!landed in #154202 (thanks for that!). But the current formatting, for the above, on nightly, is:It's also not adding trailing commas, so it formats this —
— as:
I'd suspect we might want it to add the trailing commas there.
@ytmimi: What are you thoughts on how to handle this given the pending beta bump?
cc @rust-lang/rustfmt @rust-lang/style