about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-03-24 23:19:18 +0000
committerMichael Goulet <michael@errs.io>2025-03-25 16:44:59 +0000
commitaba76d0e78aeb031f941c7a3466eb4d9d13d7a85 (patch)
tree558f4a585368e9a181ca4fefc6073e2a2af5c8ae
parent4f2ee8ca2ab3e76b5fe509358069904a58bf9083 (diff)
downloadrust-aba76d0e78aeb031f941c7a3466eb4d9d13d7a85.tar.gz
rust-aba76d0e78aeb031f941c7a3466eb4d9d13d7a85.zip
Allow defining opaques in statics and consts
-rw-r--r--clippy_utils/src/ast_utils/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/clippy_utils/src/ast_utils/mod.rs b/clippy_utils/src/ast_utils/mod.rs
index 54261079fca..6023ae9cc7b 100644
--- a/clippy_utils/src/ast_utils/mod.rs
+++ b/clippy_utils/src/ast_utils/mod.rs
@@ -336,12 +336,14 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
                 mutability: lm,
                 expr: le,
                 safety: ls,
+                define_opaque: _,
             }),
             Static(box StaticItem {
                 ty: rt,
                 mutability: rm,
                 expr: re,
                 safety: rs,
+                define_opaque: _,
             }),
         ) => lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()),
         (
@@ -350,12 +352,14 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
                 generics: lg,
                 ty: lt,
                 expr: le,
+                define_opaque: _,
             }),
             Const(box ConstItem {
                 defaultness: rd,
                 generics: rg,
                 ty: rt,
                 expr: re,
+                define_opaque: _,
             }),
         ) => eq_defaultness(*ld, *rd) && eq_generics(lg, rg) && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()),
         (
@@ -490,12 +494,14 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
                 mutability: lm,
                 expr: le,
                 safety: ls,
+                define_opaque: _,
             }),
             Static(box StaticItem {
                 ty: rt,
                 mutability: rm,
                 expr: re,
                 safety: rs,
+                define_opaque: _,
             }),
         ) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()) && ls == rs,
         (
@@ -557,12 +563,14 @@ pub fn eq_assoc_item_kind(l: &AssocItemKind, r: &AssocItemKind) -> bool {
                 generics: lg,
                 ty: lt,
                 expr: le,
+                define_opaque: _,
             }),
             Const(box ConstItem {
                 defaultness: rd,
                 generics: rg,
                 ty: rt,
                 expr: re,
+                define_opaque: _,
             }),
         ) => eq_defaultness(*ld, *rd) && eq_generics(lg, rg) && eq_ty(lt, rt) && eq_expr_opt(le.as_ref(), re.as_ref()),
         (