Don't allow unsafe statics outside of extern blocks

This commit is contained in:
Michael Goulet
2024-07-18 18:02:09 -04:00
parent 5affbb1715
commit 2f5a84ea16
6 changed files with 35 additions and 2 deletions

View File

@@ -224,6 +224,13 @@ pub struct InvalidSafetyOnBareFn {
pub span: Span,
}
#[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> {