mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
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`
This commit is contained in:
commit
fc15bc169e
1 changed files with 12 additions and 1 deletions
|
@ -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 {
|
pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
|
||||||
use ForeignItemKind::*;
|
use ForeignItemKind::*;
|
||||||
match (l, r) {
|
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 {
|
Fn(box ast::Fn {
|
||||||
defaultness: ld,
|
defaultness: ld,
|
||||||
|
|
Loading…
Reference in a new issue