Skip to content

Trailing commas in multi-line feature/lint group attributes are not preserved #4972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PatchMixolydic opened this issue Aug 30, 2021 · 1 comment

Comments

@PatchMixolydic
Copy link
Contributor

PatchMixolydic commented Aug 30, 2021

I tried formatting the following code:

#![feature(
    allocator_api,
    array_methods,
    bool_to_option,
    control_flow_enum,
    decl_macro,
    destructuring_assignment,
    drain_filter,
    duration_consts_2,
    exact_size_is_empty,
    float_interpolation,
    hash_drain_filter,
    iter_intersperse,
    label_break_value,
    maybe_uninit_array_assume_init,
    maybe_uninit_extra,
    maybe_uninit_uninit_array,
    once_cell,
)]

I expected the trailing comma to be preserved, similar to multi-line structs or function calls. Instead, the comma was removed:

     maybe_uninit_uninit_array,
-    once_cell,
+    once_cell
 )]

rustfmt version: rustfmt 1.4.37-nightly (0035d9d 2021-08-16)

@PatchMixolydic PatchMixolydic changed the title feature/lint group attributes do not have trailing commas when split across multiple lines trailing commas in multi-line feature/lint group attributes are not preserved Aug 30, 2021
@PatchMixolydic PatchMixolydic changed the title trailing commas in multi-line feature/lint group attributes are not preserved Trailing commas in multi-line feature/lint group attributes are not preserved Aug 30, 2021
@calebcartwright
Copy link
Member

Thanks for reaching out but closing as a duplicate of #3277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants