Add hard error and migration lint for unsafe attrs

This commit is contained in:
carbotaniuman
2024-06-08 18:39:09 -05:00
parent 33422e72c8
commit a23917cfd0
24 changed files with 473 additions and 53 deletions

View File

@@ -4,7 +4,7 @@ use std::{
};
use crate::fluent_generated as fluent;
use rustc_ast::{ast, Label};
use rustc_ast::Label;
use rustc_errors::{
codes::*, Applicability, Diag, DiagCtxtHandle, DiagSymbolList, Diagnostic, EmissionGuarantee,
Level, MultiSpan, SubdiagMessageOp, Subdiagnostic,
@@ -863,15 +863,6 @@ pub struct InvalidAttrAtCrateLevel {
pub item: Option<ItemFollowingInnerAttr>,
}
#[derive(Diagnostic)]
#[diag(passes_invalid_attr_unsafe)]
#[note]
pub struct InvalidAttrUnsafe {
#[primary_span]
pub span: Span,
pub name: ast::Path,
}
#[derive(Clone, Copy)]
pub struct ItemFollowingInnerAttr {
pub span: Span,