Skip to content

Commit ab15129

Browse files
authored
Rollup merge of #147713 - cjgillot:where-cfg, r=fmease
Retire ast::TyAliasWhereClauses. `ast::TyAliasWhereClauses` is a tentative to avoid forgetting predicates when manipulating the AST. It is incompatible with `cfg` attributes on where clauses. This PR uses a regular `WhereClause` for the "second" clause. Fixes #138010 cc #138037
2 parents de63d25 + 26b12a9 commit ab15129

File tree

1 file changed

+6
-4
lines changed
  • clippy_utils/src/ast_utils

1 file changed

+6
-4
lines changed

clippy_utils/src/ast_utils/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,22 +562,23 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
562562
defaultness: ld,
563563
ident: li,
564564
generics: lg,
565-
where_clauses: _,
565+
after_where_clause: lw,
566566
bounds: lb,
567567
ty: lt,
568568
}),
569569
TyAlias(box ast::TyAlias {
570570
defaultness: rd,
571571
ident: ri,
572572
generics: rg,
573-
where_clauses: _,
573+
after_where_clause: rw,
574574
bounds: rb,
575575
ty: rt,
576576
}),
577577
) => {
578578
eq_defaultness(*ld, *rd)
579579
&& eq_id(*li, *ri)
580580
&& eq_generics(lg, rg)
581+
&& over(&lw.predicates, &rw.predicates, eq_where_predicate)
581582
&& over(lb, rb, eq_generic_bound)
582583
&& both(lt.as_ref(), rt.as_ref(), |l, r| eq_ty(l, r))
583584
},
@@ -645,22 +646,23 @@ pub fn eq_assoc_item_kind(l: &AssocItemKind, r: &AssocItemKind) -> bool {
645646
defaultness: ld,
646647
ident: li,
647648
generics: lg,
648-
where_clauses: _,
649+
after_where_clause: lw,
649650
bounds: lb,
650651
ty: lt,
651652
}),
652653
Type(box TyAlias {
653654
defaultness: rd,
654655
ident: ri,
655656
generics: rg,
656-
where_clauses: _,
657+
after_where_clause: rw,
657658
bounds: rb,
658659
ty: rt,
659660
}),
660661
) => {
661662
eq_defaultness(*ld, *rd)
662663
&& eq_id(*li, *ri)
663664
&& eq_generics(lg, rg)
665+
&& over(&lw.predicates, &rw.predicates, eq_where_predicate)
664666
&& over(lb, rb, eq_generic_bound)
665667
&& both(lt.as_ref(), rt.as_ref(), |l, r| eq_ty(l, r))
666668
},

0 commit comments

Comments
 (0)