Skip to content

Commit 05b8c72

Browse files
committed
Add term
Instead of having a separate enum variant for types and consts have one but have either a const or type.
1 parent 7383a61 commit 05b8c72

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

clippy_utils/src/ast_utils.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,13 +645,20 @@ pub fn eq_generic_bound(l: &GenericBound, r: &GenericBound) -> bool {
645645
}
646646
}
647647

648+
fn eq_term(l: &Term, r: &Term) -> bool {
649+
match (l, r) {
650+
(Term::Ty(l), Term::Ty(r)) => eq_ty(l,r),
651+
(Term::Const(l), Term::Const(r)) => eq_anon_const(l,r),
652+
_ => false,
653+
}
654+
}
655+
648656
pub fn eq_assoc_constraint(l: &AssocConstraint, r: &AssocConstraint) -> bool {
649657
use AssocConstraintKind::*;
650658
eq_id(l.ident, r.ident)
651659
&& match (&l.kind, &r.kind) {
652-
(Equality { ty: l }, Equality { ty: r }) => eq_ty(l, r),
660+
(Equality { term: l }, Equality { term: r }) => eq_term(l, r),
653661
(Bound { bounds: l }, Bound { bounds: r }) => over(l, r, eq_generic_bound),
654-
(ConstEquality { c: l }, ConstEquality { c: r }) => eq_anon_const(l, r),
655662
_ => false,
656663
}
657664
}

0 commit comments

Comments
 (0)