Skip to content

Commit ea13653

Browse files
committed
Auto merge of rust-lang#124482 - spastorino:unsafe-extern-blocks, r=oli-obk
Unsafe extern blocks This implements RFC 3484. Tracking issue rust-lang#123743 and RFC rust-lang/rfcs#3484 This is better reviewed commit by commit.
2 parents 38de6e1 + bd0f908 commit ea13653

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clippy_utils/src/ast_utils.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,15 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
308308
ty: lt,
309309
mutability: lm,
310310
expr: le,
311+
safety: ls,
311312
}),
312313
Static(box StaticItem {
313314
ty: rt,
314315
mutability: rm,
315316
expr: re,
317+
safety: rs,
316318
}),
317-
) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
319+
) => lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le, re),
318320
(
319321
Const(box ConstItem {
320322
defaultness: ld,
@@ -451,13 +453,15 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
451453
ty: lt,
452454
mutability: lm,
453455
expr: le,
456+
safety: ls,
454457
}),
455458
Static(box StaticForeignItem {
456459
ty: rt,
457460
mutability: rm,
458461
expr: re,
462+
safety: rs,
459463
}),
460-
) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
464+
) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re) && ls == rs,
461465
(
462466
Fn(box ast::Fn {
463467
defaultness: ld,

0 commit comments

Comments
 (0)