Navigation Menu

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

normalize_comments = true causes malformed comments #4971

Open
mbartlett21 opened this issue Aug 30, 2021 · 2 comments · May be fixed by #5306
Open

normalize_comments = true causes malformed comments #4971

mbartlett21 opened this issue Aug 30, 2021 · 2 comments · May be fixed by #5306
Labels
a-comments only-with-option requires a non-default option value to reproduce

Comments

@mbartlett21
Copy link

Input:

struct A {
    x: usize,
    /* protected int[] observed; */
    /* (int, int)[] stack; */
}

Expected output:

struct A {
    x: usize,
    /* protected int[] observed;
     * (int, int)[] stack; */
}

or

struct A {
    x: usize,
    // protected int[] observed;
    // (int, int)[] stack;
}

Actual output:

struct A {
    x: usize,
    /* protected int[] observed; */
     * (int, int)[] stack; */
}
@mbartlett21
Copy link
Author

This seems to be caused by having either normalize_comments = true or format_code_in_doc_comments = true.

@calebcartwright calebcartwright added a-comments only-with-option requires a non-default option value to reproduce labels Sep 8, 2021
@ModProg
Copy link

ModProg commented Nov 7, 2021

wrap_comments also does this, but I got a slightly different behaviour.

const HOLLIDAYS: &[(Color, &str)] = &[
    (Color::rgb(0, 0, 0xE7), "Name"),
    // (Color::rgb(r, g, b)"#feda00", "A"),
    // (Color::rgb(r, g, b)"#06cc00", "B"),
    // (Color::rgb(r, g, b)"#0000ff", "C"),
    // (Color::rgb(r, g, b)"#00e5d4", "D"),
];

became

const HOLLIDAYS: &[(Color, &str)] = &[
    (Color::rgb(0, 0, 0xE7), "Name"),
    /* (Color::rgb(r, g, b)"#feda00", "A"),
     * (Color::rgb(r, g, b)"#06cc00", "B"),
     * (Color::rgb(r, g, b)"#0000ff", "C"),
     * (Color::rgb(r, g, b)"#00e5d4", "D"), */
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments only-with-option requires a non-default option value to reproduce
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants