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

Lost comment after struct generics #1096

Closed
dtolnay opened this issue Jul 13, 2016 · 3 comments
Closed

Lost comment after struct generics #1096

dtolnay opened this issue Jul 13, 2016 · 3 comments
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.

Comments

@dtolnay
Copy link
Member

dtolnay commented Jul 13, 2016

Before:

struct S<T> /* comment */ {
    t: T,
}

After:

struct S<T> {
    t: T,
}
@nrc
Copy link
Member

nrc commented Jul 15, 2016

We have a lot of problems like this in rustfmt, it basically comes down to the fact that we don't have spans for every token in the AST. There is no easy fix. The long term fix is getting those spans and I'm not really keen to spend time on hacky fixes in the meantime.

For the Serde issue, I'd recommend either moving the comment or skipping this struct.

@dtolnay
Copy link
Member Author

dtolnay commented Jul 31, 2016

Makes sense, I am okay with won't fix. We cleaned up our code. It was junk left from years ago.

@topecongiro topecongiro added the bug Panic, non-idempotency, invalid code, etc. label Sep 4, 2017
@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 15, 2018

I can still reproduce. This should probably be a 1.0 release blocker, since it basically silently deletes comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

No branches or pull requests

4 participants