@@ -43,7 +43,7 @@ pub fn eq_pat(l: &Pat, r: &Pat) -> bool {
4343 (Range(lf, lt, le), Range(rf, rt, re)) => {
4444 eq_expr_opt(lf.as_deref(), rf.as_deref())
4545 && eq_expr_opt(lt.as_deref(), rt.as_deref())
46- && eq_range_end(& le.node, & re.node)
46+ && eq_range_end(le.node, re.node)
4747 },
4848 (Box(l), Box(r)) => eq_pat(l, r),
4949 (Ref(l, l_pin, l_mut), Ref(r, r_pin, r_mut)) => l_pin == r_pin && l_mut == r_mut && eq_pat(l, r),
@@ -64,7 +64,7 @@ pub fn eq_pat(l: &Pat, r: &Pat) -> bool {
6464 }
6565}
6666
67- pub fn eq_range_end(l: & RangeEnd, r: & RangeEnd) -> bool {
67+ pub fn eq_range_end(l: RangeEnd, r: RangeEnd) -> bool {
6868 match (l, r) {
6969 (RangeEnd::Excluded, RangeEnd::Excluded) => true,
7070 (RangeEnd::Included(l), RangeEnd::Included(r)) => {
@@ -495,20 +495,22 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
495495 of_trait: lot,
496496 self_ty: lst,
497497 items: li,
498+ constness: lc,
498499 }),
499500 Impl(ast::Impl {
500501 generics: rg,
501502 of_trait: rot,
502503 self_ty: rst,
503504 items: ri,
505+ constness: rc,
504506 }),
505507 ) => {
506508 eq_generics(lg, rg)
507509 && both(lot.as_deref(), rot.as_deref(), |l, r| {
508510 matches!(l.safety, Safety::Default) == matches!(r.safety, Safety::Default)
509511 && matches!(l.polarity, ImplPolarity::Positive) == matches!(r.polarity, ImplPolarity::Positive)
510512 && eq_defaultness(l.defaultness, r.defaultness)
511- && matches!(l.constness , ast::Const::No) == matches!(r.constness , ast::Const::No)
513+ && matches!(lc , ast::Const::No) == matches!(rc , ast::Const::No)
512514 && eq_path(&l.trait_ref.path, &r.trait_ref.path)
513515 })
514516 && eq_ty(lst, rst)
@@ -873,7 +875,6 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
873875 (Path(lq, lp), Path(rq, rp)) => both(lq.as_deref(), rq.as_deref(), eq_qself) && eq_path(lp, rp),
874876 (TraitObject(lg, ls), TraitObject(rg, rs)) => ls == rs && over(lg, rg, eq_generic_bound),
875877 (ImplTrait(_, lg), ImplTrait(_, rg)) => over(lg, rg, eq_generic_bound),
876- (Typeof(l), Typeof(r)) => eq_expr(&l.value, &r.value),
877878 (MacCall(l), MacCall(r)) => eq_mac_call(l, r),
878879 _ => false,
879880 }
0 commit comments