about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-06-26 00:39:08 -0700
committerGitHub <noreply@github.com>2020-06-26 00:39:08 -0700
commit7f6dfb451a1d71c0ffa39688cfdeb8f7500e11e1 (patch)
tree8863f4350b86ca2d53e66c1b6fe538df3a903e0a /src/tools
parent81d2d3cf35127632927559c4eb78cfd17ff41c17 (diff)
parent86f6c0e0861f4d223d00280107cd0b31b6ebb85b (diff)
Rollup merge of #73597 - ayazhafiz:i/const-span, r=ecstatic-morse
Record span of `const` kw in GenericParamKind

Context: this is needed for a fix of https://github.com/rust-lang/rustfmt/issues/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 :slightly_smiling_face:
Diffstat (limited to 'src/tools')
-rwxr-xr-xsrc/tools/clippy/clippy_lints/src/utils/ast_utils.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs b/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs
index e60e2a81e07..e19a79dd8da 100755
--- a/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs
+++ b/src/tools/clippy/clippy_lints/src/utils/ast_utils.rs
@@ -476,7 +476,7 @@ pub fn eq_generic_param(l: &GenericParam, r: &GenericParam) -> bool {
         && match (&l.kind, &r.kind) {
             (Lifetime, Lifetime) => true,
             (Type { default: l }, Type { default: r }) => both(l, r, |l, r| eq_ty(l, r)),
-            (Const { ty: l }, Const { ty: r }) => eq_ty(l, r),
+            (Const { ty: l, kw_span: _ }, Const { ty: r, kw_span: _ }) => eq_ty(l, r),
             _ => false,
         }
         && over(&l.attrs, &r.attrs, |l, r| eq_attr(l, r))