rustfmt
rustfmt copied to clipboard
rustfmt eats comment after `->` in return type
fn a() -> /* my super detailed comment on what this bool is */ bool {}
The comment is entirely eaten:
fn a() -> bool {}
Thank you for the report. Here's where this one is happening:
https://github.com/rust-lang/rustfmt/blob/a72613be50f8afa39c2d46f732252463dc9cc14f/src/items.rs#L2059-L2078
It's also deleting it if the comment is inside the return type, as in
fn foo() -> (/*TODO: This type needs to blahblahblah*/);
It's also deleting it if the comment is inside the return type, as in
fn foo() -> (/*TODO: This type needs to blahblahblah*/);
@AloeareV This is off topic for this issue as the comment location you're pointing out is within a different part of the AST.