diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-30 06:43:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 06:43:42 +0200 |
| commit | fc15bc169e50801a7ba167042cd00c697cbd8baf (patch) | |
| tree | 0f03f31ac1de1b62f633006afabb5dd36937297d | |
| parent | 4bee9788a8ab26836a1cf50235da8f122ccdf9e0 (diff) | |
| parent | 9276ce1cf3db6045678fa04e9dc3f58bec923c4d (diff) | |
| download | rust-fc15bc169e50801a7ba167042cd00c697cbd8baf.tar.gz rust-fc15bc169e50801a7ba167042cd00c697cbd8baf.zip | |
Rollup merge of #124524 - spastorino:make-foreign-static-use-struct, r=oli-obk
Add StaticForeignItem and use it on ForeignItemKind This is in preparation for unsafe extern blocks that adds a safe variant for functions inside extern blocks. r? `@oli-obk` cc `@compiler-errors`
| -rw-r--r-- | clippy_utils/src/ast_utils.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/clippy_utils/src/ast_utils.rs b/clippy_utils/src/ast_utils.rs index 0395eb1449b..529d20126b2 100644 --- a/clippy_utils/src/ast_utils.rs +++ b/clippy_utils/src/ast_utils.rs @@ -446,7 +446,18 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool { pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool { use ForeignItemKind::*; match (l, r) { - (Static(lt, lm, le), Static(rt, rm, re)) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re), + ( + Static(box StaticForeignItem { + ty: lt, + mutability: lm, + expr: le, + }), + Static(box StaticForeignItem { + ty: rt, + mutability: rm, + expr: re, + }), + ) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re), ( Fn(box ast::Fn { defaultness: ld, |
