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

Trailing comments removed with rustfmt::skip #5033

Closed
dhardy opened this issue Oct 18, 2021 · 0 comments · Fixed by #5094
Closed

Trailing comments removed with rustfmt::skip #5033

dhardy opened this issue Oct 18, 2021 · 0 comments · Fixed by #5094

Comments

@dhardy
Copy link

dhardy commented Oct 18, 2021

Looks similar to #4028 but posting a new issue since that was apparently solved.

Given this file, test.rs:

// leading comment

#![rustfmt::skip]

fn main() {
    println!("main"); // commented
}

// post comment

running rustfmt test.rs results in this output:

// leading comment

#![rustfmt::skip]

fn main() {
    println!("main"); // commented
}

This is loss-of-information, especially considering we can't rely on git for roll-back (#3862).

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

Successfully merging a pull request may close this issue.

2 participants