rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Formatting a line comment inbetween a function parameter and its type results in the type being commented out

Open 5225225 opened this issue 8 months ago • 0 comments

Formatting

fn foo(x: //comment here
u32) {} 

results in (on playground 1.8.0-nightly (2025-03-22 b48576b4db))

pub fn foo(x: //comment here u32
) {
}

I agree this is a remarkably weird place to put a comment, but it should at least not result in breaking compilation.

5225225 avatar Mar 23 '25 21:03 5225225