From 8d7814a89f9ec7147822a17c9cf3b59e164705e2 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 23 Oct 2024 15:45:54 -0700 Subject: [PATCH] Preserve extern static unsafety in ForeignItem::Verbatim --- src/item.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item.rs b/src/item.rs index de83e28ae..a24623edb 100644 --- a/src/item.rs +++ b/src/item.rs @@ -1896,7 +1896,7 @@ pub(crate) mod parsing { input.parse::()?; } let semi_token: Token![;] = input.parse()?; - if safe || has_value { + if unsafety.is_some() || safe || has_value { Ok(ForeignItem::Verbatim(verbatim::between(&begin, input))) } else { Ok(ForeignItem::Static(ForeignItemStatic {