Skip to content

Commit a671ea4

Browse files
authored
Rollup merge of rust-lang#73597 - ayazhafiz:i/const-span, r=ecstatic-morse
Record span of `const` kw in GenericParamKind Context: this is needed for a fix of 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 🙂
2 parents 80bcbf5 + 7c1b3aa commit a671ea4

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)