Skip to content

Commit

Permalink
Preserve extern static unsafety in ForeignItem::Verbatim
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 23, 2024
1 parent 2e159bc commit 8d7814a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ pub(crate) mod parsing {
input.parse::<Expr>()?;
}
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 {
Expand Down

0 comments on commit 8d7814a

Please sign in to comment.