Skip to content

Commit 537ce5c

Browse files
committed
Handle safety keyword for extern block inner items
1 parent 9f4a2dd commit 537ce5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_utils/src/ast_utils.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,15 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
451451
ty: lt,
452452
mutability: lm,
453453
expr: le,
454+
safety: ls,
454455
}),
455456
Static(box StaticForeignItem {
456457
ty: rt,
457458
mutability: rm,
458459
expr: re,
460+
safety: rs,
459461
}),
460-
) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
462+
) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re) && ls == rs,
461463
(
462464
Fn(box ast::Fn {
463465
defaultness: ld,

0 commit comments

Comments
 (0)