diff options
| author | kadmin <julianknodt@gmail.com> | 2021-07-30 08:56:45 +0000 |
|---|---|---|
| committer | kadmin <julianknodt@gmail.com> | 2022-01-17 17:20:57 +0000 |
| commit | 7383a6196847fbf2d233ad252af2c3a555f0be9e (patch) | |
| tree | 95a1ce19306fee203ac0896e8fbb28446c77a082 | |
| parent | 55fa2ea00c873d09c089e234f246798f53520e9b (diff) | |
| download | rust-7383a6196847fbf2d233ad252af2c3a555f0be9e.tar.gz rust-7383a6196847fbf2d233ad252af2c3a555f0be9e.zip | |
add eq constraints on associated constants
| -rw-r--r-- | clippy_utils/src/ast_utils.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clippy_utils/src/ast_utils.rs b/clippy_utils/src/ast_utils.rs index 3d3180521ab..d4f037677e0 100644 --- a/clippy_utils/src/ast_utils.rs +++ b/clippy_utils/src/ast_utils.rs @@ -645,12 +645,13 @@ pub fn eq_generic_bound(l: &GenericBound, r: &GenericBound) -> bool { } } -pub fn eq_assoc_constraint(l: &AssocTyConstraint, r: &AssocTyConstraint) -> bool { - use AssocTyConstraintKind::*; +pub fn eq_assoc_constraint(l: &AssocConstraint, r: &AssocConstraint) -> bool { + use AssocConstraintKind::*; eq_id(l.ident, r.ident) && match (&l.kind, &r.kind) { (Equality { ty: l }, Equality { ty: r }) => eq_ty(l, r), (Bound { bounds: l }, Bound { bounds: r }) => over(l, r, eq_generic_bound), + (ConstEquality { c: l }, ConstEquality { c: r }) => eq_anon_const(l, r), _ => false, } } |
