We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create a file with this input:
fn a1(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] a: u8) {} fn b1(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] bb: u8) {} fn a2(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] a: u8) {} fn b2(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] bb: u8) {}
Run cargo fmt. a1 and b1 will have their attributes stripped. Remove one letter from the line and it will not be stripped as seen in a2 and b2.
cargo fmt
a1
b1
a2
b2
fn a1(a: u8) {} fn b1(bb: u8) {} fn a2( #[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] a: u8, ) { } fn b2( #[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] bb: u8, ) { }
The text was updated successfully, but these errors were encountered:
Confirmed bug that's still reproducible on master/v2.0.0-rc.1-nightly.
I believe this could be fixed by updating the Spanned impl for Param
Changing:
rustfmt/rustfmt-core/rustfmt-lib/src/spanned.rs
Lines 112 to 120 in facba6a
to something like:
impl Spanned for ast::Param { fn span(&self) -> Span { if crate::items::is_named_param(self) { mk_sp(crate::items::span_lo_for_param(self), self.ty.span.hi()) } else { self.ty.span } } }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Create a file with this input:
Run
cargo fmt
.a1
andb1
will have their attributes stripped. Remove one letter from the line and it will not be stripped as seen ina2
andb2
.The text was updated successfully, but these errors were encountered: