Skip to content

Commit fc15bc1

Browse files
authored
Rollup merge of rust-lang#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`
2 parents 4bee978 + 9276ce1 commit fc15bc1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

clippy_utils/src/ast_utils.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,18 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
446446
pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
447447
use ForeignItemKind::*;
448448
match (l, r) {
449-
(Static(lt, lm, le), Static(rt, rm, re)) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
449+
(
450+
Static(box StaticForeignItem {
451+
ty: lt,
452+
mutability: lm,
453+
expr: le,
454+
}),
455+
Static(box StaticForeignItem {
456+
ty: rt,
457+
mutability: rm,
458+
expr: re,
459+
}),
460+
) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
450461
(
451462
Fn(box ast::Fn {
452463
defaultness: ld,

0 commit comments

Comments
 (0)