Skip to content

Commit 27d320d

Browse files
authored
Rollup merge of #124524 - spastorino:make-foreign-static-use-struct, 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`
2 parents 997d5f2 + fafa690 commit 27d320d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/items.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3325,11 +3325,11 @@ impl Rewrite for ast::ForeignItem {
33253325
.map(|(s, _, _)| format!("{};", s))
33263326
}
33273327
}
3328-
ast::ForeignItemKind::Static(ref ty, mutability, _) => {
3328+
ast::ForeignItemKind::Static(ref static_foreign_item) => {
33293329
// FIXME(#21): we're dropping potential comments in between the
33303330
// function kw here.
33313331
let vis = format_visibility(context, &self.vis);
3332-
let mut_str = format_mutability(mutability);
3332+
let mut_str = format_mutability(static_foreign_item.mutability);
33333333
let prefix = format!(
33343334
"{}static {}{}:",
33353335
vis,
@@ -3340,7 +3340,7 @@ impl Rewrite for ast::ForeignItem {
33403340
rewrite_assign_rhs(
33413341
context,
33423342
prefix,
3343-
&**ty,
3343+
&static_foreign_item.ty,
33443344
&RhsAssignKind::Ty,
33453345
shape.sub_width(1)?,
33463346
)

0 commit comments

Comments
 (0)