Skip to content

Commit aba76d0

Browse files
Allow defining opaques in statics and consts
1 parent 4f2ee8c commit aba76d0

File tree

1 file changed

+8
-0
lines changed
  • clippy_utils/src/ast_utils

1 file changed

+8
-0
lines changed

clippy_utils/src/ast_utils/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,14 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
336336
mutability: lm,
337337
expr: le,
338338
safety: ls,
339+
define_opaque: _,
339340
}),
340341
Static(box StaticItem {
341342
ty: rt,
342343
mutability: rm,
343344
expr: re,
344345
safety: rs,
346+
define_opaque: _,
345347
}),
346348
) => lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()),
347349
(
@@ -350,12 +352,14 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
350352
generics: lg,
351353
ty: lt,
352354
expr: le,
355+
define_opaque: _,
353356
}),
354357
Const(box ConstItem {
355358
defaultness: rd,
356359
generics: rg,
357360
ty: rt,
358361
expr: re,
362+
define_opaque: _,
359363
}),
360364
) => eq_defaultness(*ld, *rd) && eq_generics(lg, rg) && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()),
361365
(
@@ -490,12 +494,14 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
490494
mutability: lm,
491495
expr: le,
492496
safety: ls,
497+
define_opaque: _,
493498
}),
494499
Static(box StaticItem {
495500
ty: rt,
496501
mutability: rm,
497502
expr: re,
498503
safety: rs,
504+
define_opaque: _,
499505
}),
500506
) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()) && ls == rs,
501507
(
@@ -557,12 +563,14 @@ pub fn eq_assoc_item_kind(l: &AssocItemKind, r: &AssocItemKind) -> bool {
557563
generics: lg,
558564
ty: lt,
559565
expr: le,
566+
define_opaque: _,
560567
}),
561568
Const(box ConstItem {
562569
defaultness: rd,
563570
generics: rg,
564571
ty: rt,
565572
expr: re,
573+
define_opaque: _,
566574
}),
567575
) => eq_defaultness(*ld, *rd) && eq_generics(lg, rg) && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()),
568576
(

0 commit comments

Comments
 (0)