Replace #[error(..)] etc. to #[diag(..)]

This commit is contained in:
finalchild 2022-08-22 01:24:47 +09:00
parent 70e0af632d
commit 09d495cc15

View File

@ -7,7 +7,7 @@ use rustc_span::{Span, Symbol};
use crate::ast_validation::ForbiddenLetReason; use crate::ast_validation::ForbiddenLetReason;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_let)] #[diag(ast_passes::forbidden_let)]
#[note] #[note]
pub struct ForbiddenLet { pub struct ForbiddenLet {
#[primary_span] #[primary_span]
@ -31,21 +31,21 @@ impl AddSubdiagnostic for ForbiddenLetReason {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_assoc_constraint)] #[diag(ast_passes::forbidden_assoc_constraint)]
pub struct ForbiddenAssocConstraint { pub struct ForbiddenAssocConstraint {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::keyword_lifetime)] #[diag(ast_passes::keyword_lifetime)]
pub struct KeywordLifetime { pub struct KeywordLifetime {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::invalid_label)] #[diag(ast_passes::invalid_label)]
pub struct InvalidLabel { pub struct InvalidLabel {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -53,7 +53,7 @@ pub struct InvalidLabel {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::invalid_visibility, code = "E0449")] #[diag(ast_passes::invalid_visibility, code = "E0449")]
pub struct InvalidVisibility { pub struct InvalidVisibility {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -72,7 +72,7 @@ pub enum InvalidVisibilityNote {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::trait_fn_async, code = "E0706")] #[diag(ast_passes::trait_fn_async, code = "E0706")]
#[note] #[note]
#[note(ast_passes::note2)] #[note(ast_passes::note2)]
pub struct TraitFnAsync { pub struct TraitFnAsync {
@ -83,7 +83,7 @@ pub struct TraitFnAsync {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::trait_fn_const, code = "E0379")] #[diag(ast_passes::trait_fn_const, code = "E0379")]
pub struct TraitFnConst { pub struct TraitFnConst {
#[primary_span] #[primary_span]
#[label] #[label]
@ -91,21 +91,21 @@ pub struct TraitFnConst {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_lifetime_bound)] #[diag(ast_passes::forbidden_lifetime_bound)]
pub struct ForbiddenLifetimeBound { pub struct ForbiddenLifetimeBound {
#[primary_span] #[primary_span]
pub spans: Vec<Span>, pub spans: Vec<Span>,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_non_lifetime_param)] #[diag(ast_passes::forbidden_non_lifetime_param)]
pub struct ForbiddenNonLifetimeParam { pub struct ForbiddenNonLifetimeParam {
#[primary_span] #[primary_span]
pub spans: Vec<Span>, pub spans: Vec<Span>,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[fatal(ast_passes::fn_param_too_many)] #[diag(ast_passes::fn_param_too_many)]
pub struct FnParamTooMany { pub struct FnParamTooMany {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -113,21 +113,21 @@ pub struct FnParamTooMany {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_c_var_args_only)] #[diag(ast_passes::fn_param_c_var_args_only)]
pub struct FnParamCVarArgsOnly { pub struct FnParamCVarArgsOnly {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_c_var_args_not_last)] #[diag(ast_passes::fn_param_c_var_args_not_last)]
pub struct FnParamCVarArgsNotLast { pub struct FnParamCVarArgsNotLast {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_doc_comment)] #[diag(ast_passes::fn_param_doc_comment)]
pub struct FnParamDocComment { pub struct FnParamDocComment {
#[primary_span] #[primary_span]
#[label] #[label]
@ -135,14 +135,14 @@ pub struct FnParamDocComment {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_forbidden_attr)] #[diag(ast_passes::fn_param_forbidden_attr)]
pub struct FnParamForbiddenAttr { pub struct FnParamForbiddenAttr {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_forbidden_self)] #[diag(ast_passes::fn_param_forbidden_self)]
#[note] #[note]
pub struct FnParamForbiddenSelf { pub struct FnParamForbiddenSelf {
#[primary_span] #[primary_span]
@ -151,7 +151,7 @@ pub struct FnParamForbiddenSelf {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_default)] #[diag(ast_passes::forbidden_default)]
pub struct ForbiddenDefault { pub struct ForbiddenDefault {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -160,7 +160,7 @@ pub struct ForbiddenDefault {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::assoc_const_without_body)] #[diag(ast_passes::assoc_const_without_body)]
pub struct AssocConstWithoutBody { pub struct AssocConstWithoutBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -169,7 +169,7 @@ pub struct AssocConstWithoutBody {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::assoc_fn_without_body)] #[diag(ast_passes::assoc_fn_without_body)]
pub struct AssocFnWithoutBody { pub struct AssocFnWithoutBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -178,7 +178,7 @@ pub struct AssocFnWithoutBody {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::assoc_type_without_body)] #[diag(ast_passes::assoc_type_without_body)]
pub struct AssocTypeWithoutBody { pub struct AssocTypeWithoutBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -187,7 +187,7 @@ pub struct AssocTypeWithoutBody {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::const_without_body)] #[diag(ast_passes::const_without_body)]
pub struct ConstWithoutBody { pub struct ConstWithoutBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -196,7 +196,7 @@ pub struct ConstWithoutBody {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::static_without_body)] #[diag(ast_passes::static_without_body)]
pub struct StaticWithoutBody { pub struct StaticWithoutBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -205,7 +205,7 @@ pub struct StaticWithoutBody {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::ty_alias_without_body)] #[diag(ast_passes::ty_alias_without_body)]
pub struct TyAliasWithoutBody { pub struct TyAliasWithoutBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -214,7 +214,7 @@ pub struct TyAliasWithoutBody {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(ast_passes::fn_without_body)] #[diag(ast_passes::fn_without_body)]
pub struct FnWithoutBody { pub struct FnWithoutBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,