Skip to content

Commit eefeff5

Browse files
committed
mgca: Add ConstArg representation for const items
1 parent 33232af commit eefeff5

File tree

1 file changed

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

1 file changed

+6
-6
lines changed

clippy_utils/src/ast_utils/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,23 +358,23 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
358358
ident: li,
359359
generics: lg,
360360
ty: lt,
361-
expr: le,
361+
body: lb,
362362
define_opaque: _,
363363
}),
364364
Const(box ConstItem {
365365
defaultness: rd,
366366
ident: ri,
367367
generics: rg,
368368
ty: rt,
369-
expr: re,
369+
body: rb,
370370
define_opaque: _,
371371
}),
372372
) => {
373373
eq_defaultness(*ld, *rd)
374374
&& eq_id(*li, *ri)
375375
&& eq_generics(lg, rg)
376376
&& eq_ty(lt, rt)
377-
&& eq_expr_opt(le.as_deref(), re.as_deref())
377+
&& both(lb.as_deref(), rb.as_deref(), |l, r| eq_anon_const(l, r))
378378
},
379379
(
380380
Fn(box ast::Fn {
@@ -612,23 +612,23 @@ pub fn eq_assoc_item_kind(l: &AssocItemKind, r: &AssocItemKind) -> bool {
612612
ident: li,
613613
generics: lg,
614614
ty: lt,
615-
expr: le,
615+
body: lb,
616616
define_opaque: _,
617617
}),
618618
Const(box ConstItem {
619619
defaultness: rd,
620620
ident: ri,
621621
generics: rg,
622622
ty: rt,
623-
expr: re,
623+
body: rb,
624624
define_opaque: _,
625625
}),
626626
) => {
627627
eq_defaultness(*ld, *rd)
628628
&& eq_id(*li, *ri)
629629
&& eq_generics(lg, rg)
630630
&& eq_ty(lt, rt)
631-
&& eq_expr_opt(le.as_deref(), re.as_deref())
631+
&& both(lb.as_deref(), rb.as_deref(), |l, r| eq_anon_const(l, r))
632632
},
633633
(
634634
Fn(box ast::Fn {

0 commit comments

Comments
 (0)