Rollup merge of #154193 - JonathanBrouwer:external-static, r=jdonszelmann

Implement EII for statics

This PR implements EII for statics. I've tried to mirror the implementation for functions in a few places, this causes some duplicate code but I'm also not really sure whether there's a clean way to merge the implementations.

This does not implement defaults for static EIIs yet, I will do that in a followup PR
This commit is contained in:
Jonathan Brouwer
2026-04-13 20:19:56 +02:00
committed by GitHub
+4
View File
@@ -339,6 +339,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
expr: le,
safety: ls,
define_opaque: _,
eii_impls: _,
}),
Static(box StaticItem {
ident: ri,
@@ -347,6 +348,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
expr: re,
safety: rs,
define_opaque: _,
eii_impls: _,
}),
) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
(
@@ -540,6 +542,7 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
expr: le,
safety: ls,
define_opaque: _,
eii_impls: _,
}),
Static(box StaticItem {
ident: ri,
@@ -548,6 +551,7 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
expr: re,
safety: rs,
define_opaque: _,
eii_impls: _,
}),
) => eq_id(*li, *ri) && eq_ty(lt, rt) && lm == rm && eq_expr_opt(le.as_deref(), re.as_deref()) && ls == rs,
(