about summary refs log tree commit diff
path: root/compiler/rustc_hir/src/def.rs
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_hir/src/def.rs
parentb4cbdb7246c633ab0ebc6ae4bbe4883cde79e787 (diff)
downloadrust-bac72cf7cf823bbf10e7d093a8225490bf8d1350.tar.gz
rust-bac72cf7cf823bbf10e7d093a8225490bf8d1350.zip
Add safe/unsafe to static inside extern blocks
Diffstat (limited to 'compiler/rustc_hir/src/def.rs')
-rw-r--r--compiler/rustc_hir/src/def.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs
index 649a08b6972..b1854923247 100644
--- a/compiler/rustc_hir/src/def.rs
+++ b/compiler/rustc_hir/src/def.rs
@@ -76,6 +76,8 @@ pub enum DefKind {
     /// Constant generic parameter: `struct Foo<const N: usize> { ... }`
     ConstParam,
     Static {
+        /// Whether it's a `unsafe static`, `safe static` (inside extern only) or just a `static`.
+        safety: hir::Safety,
         /// Whether it's a `static mut` or just a `static`.
         mutability: ast::Mutability,
         /// Whether it's an anonymous static generated for nested allocations.