rustfmt
rustfmt copied to clipboard
rustfmt deletes comment after arrow in Fn type
Input:
fn foo(f: &dyn Fn(i32) -> /*result*/ i32) {
}
after rustfmt becomes
fn foo(f: &dyn Fn(i32) -> i32) {}
Expected
Preserve /*result*/ comment
Observed
Comment deleted.
Thanks for the report. This feels related to https://github.com/rust-lang/rustfmt/issues/5874
Thanks for the link! I didn't find that issue because I was searching with Fn. Feel free to close as duplicate.
Triage: it does feel related to #5874, though worth keeping separate since this is removing a comment in a param type decl position.