Fail when using safe/unsafe items inside unadorned extern blocks
This commit is contained in:
parent
2a377122dd
commit
b4cbdb7246
9 changed files with 111 additions and 22 deletions
|
@ -216,6 +216,15 @@ pub enum ExternBlockSuggestion {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(ast_passes_extern_invalid_safety)]
|
||||
pub struct InvalidSafetyOnExtern {
|
||||
#[primary_span]
|
||||
pub item_span: Span,
|
||||
#[suggestion(code = "", applicability = "maybe-incorrect")]
|
||||
pub block: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(ast_passes_bound_in_context)]
|
||||
pub struct BoundInContext<'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue