Skip to content

Commit

Permalink
Rollup merge of #124524 - spastorino:make-foreign-static-use-struct, …
Browse files Browse the repository at this point in the history
…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`
  • Loading branch information
matthiaskrgr authored Apr 30, 2024
2 parents 997d5f2 + fafa690 commit 27d320d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3325,11 +3325,11 @@ impl Rewrite for ast::ForeignItem {
.map(|(s, _, _)| format!("{};", s))
}
}
ast::ForeignItemKind::Static(ref ty, mutability, _) => {
ast::ForeignItemKind::Static(ref static_foreign_item) => {
// FIXME(#21): we're dropping potential comments in between the
// function kw here.
let vis = format_visibility(context, &self.vis);
let mut_str = format_mutability(mutability);
let mut_str = format_mutability(static_foreign_item.mutability);
let prefix = format!(
"{}static {}{}:",
vis,
Expand All @@ -3340,7 +3340,7 @@ impl Rewrite for ast::ForeignItem {
rewrite_assign_rhs(
context,
prefix,
&**ty,
&static_foreign_item.ty,
&RhsAssignKind::Ty,
shape.sub_width(1)?,
)
Expand Down

0 comments on commit 27d320d

Please sign in to comment.