diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-30 06:43:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 06:43:42 +0200 |
| commit | ea3d99eaa8f969f778be8f40f0a538430442b8d8 (patch) | |
| tree | 833c8cc40182ae090dc26961af46bcdce48f2dee /compiler/rustc_parse/src | |
| parent | f4c9f29f276308cad88f221084a2e0cb1ffeefec (diff) | |
| parent | f06e0f783793ab5592b6799876d9329b1490bc30 (diff) | |
| download | rust-ea3d99eaa8f969f778be8f40f0a538430442b8d8.tar.gz rust-ea3d99eaa8f969f778be8f40f0a538430442b8d8.zip | |
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`
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index ed51710564a..848277c4611 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1191,7 +1191,11 @@ impl<'a> Parser<'a> { ident_span: ident.span, const_span, }); - ForeignItemKind::Static(ty, Mutability::Not, expr) + ForeignItemKind::Static(Box::new(StaticForeignItem { + ty, + mutability: Mutability::Not, + expr, + })) } _ => return self.error_bad_item_kind(span, &kind, "`extern` blocks"), }, |
