rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

rustfmt deletes comment after arrow in Fn type

Open findepi opened this issue 8 months ago • 2 comments

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.

findepi avatar Feb 12 '25 14:02 findepi