about summary refs log tree commit diff
path: root/compiler/rustc_expand/src
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2024-05-07 14:43:23 +0200
committerSantiago Pastorino <spastorino@gmail.com>2024-06-04 14:19:43 -0300
commitbac72cf7cf823bbf10e7d093a8225490bf8d1350 (patch)
tree099d8483538cf745a4b2e7040119c4ad890ae6aa /compiler/rustc_expand/src
parentb4cbdb7246c633ab0ebc6ae4bbe4883cde79e787 (diff)
downloadrust-bac72cf7cf823bbf10e7d093a8225490bf8d1350.tar.gz
rust-bac72cf7cf823bbf10e7d093a8225490bf8d1350.zip
Add safe/unsafe to static inside extern blocks
Diffstat (limited to 'compiler/rustc_expand/src')
-rw-r--r--compiler/rustc_expand/src/build.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs
index 1b6e191c2eb..b3d41908260 100644
--- a/compiler/rustc_expand/src/build.rs
+++ b/compiler/rustc_expand/src/build.rs
@@ -631,7 +631,10 @@ impl<'a> ExtCtxt<'a> {
             span,
             name,
             AttrVec::new(),
-            ast::ItemKind::Static(ast::StaticItem { ty, mutability, expr: Some(expr) }.into()),
+            ast::ItemKind::Static(
+                ast::StaticItem { ty, safety: ast::Safety::Default, mutability, expr: Some(expr) }
+                    .into(),
+            ),
         )
     }