Skip to content

Commit 7c1b3aa

Browse files
committed
Record span of const kw in GenericParamKind
Context: this is needed to fix rust-lang/rustfmt#4263, which currently records the span of a const generic param incorrectly because the location of the `const` kw is not known. I am not sure how to add tests for this; any guidance in how to do so would be appreciated 🙂
1 parent 7c15f30 commit 7c1b3aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/utils/ast_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ pub fn eq_generic_param(l: &GenericParam, r: &GenericParam) -> bool {
476476
&& match (&l.kind, &r.kind) {
477477
(Lifetime, Lifetime) => true,
478478
(Type { default: l }, Type { default: r }) => both(l, r, |l, r| eq_ty(l, r)),
479-
(Const { ty: l }, Const { ty: r }) => eq_ty(l, r),
479+
(Const { ty: l, kw_span: _ }, Const { ty: r, kw_span: _ }) => eq_ty(l, r),
480480
_ => false,
481481
}
482482
&& over(&l.attrs, &r.attrs, |l, r| eq_attr(l, r))

0 commit comments

Comments
 (0)