Skip to content
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

Line comments turned into block comments despite normalize_comments #4430

Closed
micouy opened this issue Sep 22, 2020 · 1 comment · Fixed by #5104
Closed

Line comments turned into block comments despite normalize_comments #4430

micouy opened this issue Sep 22, 2020 · 1 comment · Fixed by #5104
Assignees
Labels
a-comments a-matches match arms, patterns, blocks, etc only-with-option requires a non-default option value to reproduce poor-formatting

Comments

@micouy
Copy link

micouy commented Sep 22, 2020

Input & expected output

fn main() {
    match a {
        b => c,
        // b => c,
        // b => c,
    }
}

Output

fn main() {
    match a {
        b => c,
        /* b => c,
         * b => c, */
    }
}

Config

imports_layout = "HorizontalVertical"
max_width = 80
normalize_comments = true
match_arm_blocks = false
wrap_comments = true
blank_lines_upper_bound = 2
merge_imports = true
report_fixme = "Always"
report_todo = "Always"
use_field_init_shorthand = true
reorder_impl_items = true

Unfortunately I can't reproduce it in the playground.

EDIT: changed the example code

  • rustfmt version: rustfmt 1.4.21-nightly (01f2eadc 2020-09-04)
  • From where did you install rustfmt?: rustup
@calebcartwright
Copy link
Member

Seems to only happen within a match and with normalize_comments enabled

@calebcartwright calebcartwright added a-comments a-matches match arms, patterns, blocks, etc only-with-option requires a non-default option value to reproduce labels Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments a-matches match arms, patterns, blocks, etc only-with-option requires a non-default option value to reproduce poor-formatting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants