Skip to content

Commit 07b6b32

Browse files
committed
Trait aliases are rare large ast nodes, box them
1 parent 05aaed9 commit 07b6b32

File tree

1 file changed

+12
-3
lines changed
  • clippy_utils/src/ast_utils

1 file changed

+12
-3
lines changed

clippy_utils/src/ast_utils/mod.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,18 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
473473
&& over(lb, rb, eq_generic_bound)
474474
&& over(lis, ris, |l, r| eq_item(l, r, eq_assoc_item_kind))
475475
},
476-
(TraitAlias(li, lg, lb), TraitAlias(ri, rg, rb)) => {
477-
eq_id(*li, *ri) && eq_generics(lg, rg) && over(lb, rb, eq_generic_bound)
478-
},
476+
(
477+
TraitAlias(box ast::TraitAlias {
478+
ident: li,
479+
generics: lg,
480+
bounds: lb,
481+
}),
482+
TraitAlias(box ast::TraitAlias {
483+
ident: ri,
484+
generics: rg,
485+
bounds: rb,
486+
}),
487+
) => eq_id(*li, *ri) && eq_generics(lg, rg) && over(lb, rb, eq_generic_bound),
479488
(
480489
Impl(ast::Impl {
481490
generics: lg,

0 commit comments

Comments
 (0)