fix: use correct spans for params with attrs
This commit is contained in:
parent
59063e8b40
commit
a59cac29f4
@ -104,7 +104,7 @@ fn span(&self) -> Span {
|
||||
impl Spanned for ast::Param {
|
||||
fn span(&self) -> Span {
|
||||
if crate::items::is_named_param(self) {
|
||||
mk_sp(self.pat.span.lo(), self.ty.span.hi())
|
||||
mk_sp(crate::items::span_lo_for_param(self), self.ty.span.hi())
|
||||
} else {
|
||||
self.ty.span
|
||||
}
|
||||
|
4
tests/source/issue_4032.rs
Normal file
4
tests/source/issue_4032.rs
Normal file
@ -0,0 +1,4 @@
|
||||
fn a1(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] a: u8) {}
|
||||
fn b1(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] bb: u8) {}
|
||||
fn a2(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] a: u8) {}
|
||||
fn b2(#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] bb: u8) {}
|
18
tests/target/issue_4032.rs
Normal file
18
tests/target/issue_4032.rs
Normal file
@ -0,0 +1,18 @@
|
||||
fn a1(
|
||||
#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]
|
||||
a: u8,
|
||||
) {
|
||||
}
|
||||
fn b1(
|
||||
#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]
|
||||
bb: u8,
|
||||
) {
|
||||
}
|
||||
fn a2(
|
||||
#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] a: u8,
|
||||
) {
|
||||
}
|
||||
fn b2(
|
||||
#[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] bb: u8,
|
||||
) {
|
||||
}
|
Loading…
Reference in New Issue
Block a user