about summary refs log tree commit diff
path: root/compiler/rustc_ast_passes/src/errors.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-07-18 18:02:09 -0400
committerMichael Goulet <michael@errs.io>2024-07-18 18:02:29 -0400
commit2f5a84ea16f232f8a0709ea567bca0cfd90b44cf (patch)
treedfa97ce2859075ccf2a6609fb4b4cb97fb7c4bf1 /compiler/rustc_ast_passes/src/errors.rs
parent5affbb17153bc69a9d5d8d2faa4e399a014a211e (diff)
downloadrust-2f5a84ea16f232f8a0709ea567bca0cfd90b44cf.tar.gz
rust-2f5a84ea16f232f8a0709ea567bca0cfd90b44cf.zip
Don't allow unsafe statics outside of extern blocks
Diffstat (limited to 'compiler/rustc_ast_passes/src/errors.rs')
-rw-r--r--compiler/rustc_ast_passes/src/errors.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_ast_passes/src/errors.rs b/compiler/rustc_ast_passes/src/errors.rs
index 460da254653..783bca6b695 100644
--- a/compiler/rustc_ast_passes/src/errors.rs
+++ b/compiler/rustc_ast_passes/src/errors.rs
@@ -225,6 +225,13 @@ pub struct InvalidSafetyOnBareFn {
 }
 
 #[derive(Diagnostic)]
+#[diag(ast_passes_unsafe_static)]
+pub struct UnsafeStatic {
+    #[primary_span]
+    pub span: Span,
+}
+
+#[derive(Diagnostic)]
 #[diag(ast_passes_bound_in_context)]
 pub struct BoundInContext<'a> {
     #[primary_span]