Skip to content

Commit

Permalink
Replace #[error(..)] etc. to #[diag(..)]
Browse files Browse the repository at this point in the history
  • Loading branch information
finalchild committed Aug 21, 2022
1 parent 70e0af6 commit 09d495c
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions compiler/rustc_ast_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_span::{Span, Symbol};
use crate::ast_validation::ForbiddenLetReason;

#[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_let)]
#[diag(ast_passes::forbidden_let)]
#[note]
pub struct ForbiddenLet {
#[primary_span]
Expand All @@ -31,29 +31,29 @@ impl AddSubdiagnostic for ForbiddenLetReason {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_assoc_constraint)]
#[diag(ast_passes::forbidden_assoc_constraint)]
pub struct ForbiddenAssocConstraint {
#[primary_span]
pub span: Span,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::keyword_lifetime)]
#[diag(ast_passes::keyword_lifetime)]
pub struct KeywordLifetime {
#[primary_span]
pub span: Span,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::invalid_label)]
#[diag(ast_passes::invalid_label)]
pub struct InvalidLabel {
#[primary_span]
pub span: Span,
pub name: Symbol,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::invalid_visibility, code = "E0449")]
#[diag(ast_passes::invalid_visibility, code = "E0449")]
pub struct InvalidVisibility {
#[primary_span]
pub span: Span,
Expand All @@ -72,7 +72,7 @@ pub enum InvalidVisibilityNote {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::trait_fn_async, code = "E0706")]
#[diag(ast_passes::trait_fn_async, code = "E0706")]
#[note]
#[note(ast_passes::note2)]
pub struct TraitFnAsync {
Expand All @@ -83,66 +83,66 @@ pub struct TraitFnAsync {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::trait_fn_const, code = "E0379")]
#[diag(ast_passes::trait_fn_const, code = "E0379")]
pub struct TraitFnConst {
#[primary_span]
#[label]
pub span: Span,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_lifetime_bound)]
#[diag(ast_passes::forbidden_lifetime_bound)]
pub struct ForbiddenLifetimeBound {
#[primary_span]
pub spans: Vec<Span>,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_non_lifetime_param)]
#[diag(ast_passes::forbidden_non_lifetime_param)]
pub struct ForbiddenNonLifetimeParam {
#[primary_span]
pub spans: Vec<Span>,
}

#[derive(SessionDiagnostic)]
#[fatal(ast_passes::fn_param_too_many)]
#[diag(ast_passes::fn_param_too_many)]
pub struct FnParamTooMany {
#[primary_span]
pub span: Span,
pub max_num_args: usize,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_c_var_args_only)]
#[diag(ast_passes::fn_param_c_var_args_only)]
pub struct FnParamCVarArgsOnly {
#[primary_span]
pub span: Span,
}

#[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 {
#[primary_span]
pub span: Span,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_doc_comment)]
#[diag(ast_passes::fn_param_doc_comment)]
pub struct FnParamDocComment {
#[primary_span]
#[label]
pub span: Span,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_forbidden_attr)]
#[diag(ast_passes::fn_param_forbidden_attr)]
pub struct FnParamForbiddenAttr {
#[primary_span]
pub span: Span,
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::fn_param_forbidden_self)]
#[diag(ast_passes::fn_param_forbidden_self)]
#[note]
pub struct FnParamForbiddenSelf {
#[primary_span]
Expand All @@ -151,7 +151,7 @@ pub struct FnParamForbiddenSelf {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::forbidden_default)]
#[diag(ast_passes::forbidden_default)]
pub struct ForbiddenDefault {
#[primary_span]
pub span: Span,
Expand All @@ -160,7 +160,7 @@ pub struct ForbiddenDefault {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::assoc_const_without_body)]
#[diag(ast_passes::assoc_const_without_body)]
pub struct AssocConstWithoutBody {
#[primary_span]
pub span: Span,
Expand All @@ -169,7 +169,7 @@ pub struct AssocConstWithoutBody {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::assoc_fn_without_body)]
#[diag(ast_passes::assoc_fn_without_body)]
pub struct AssocFnWithoutBody {
#[primary_span]
pub span: Span,
Expand All @@ -178,7 +178,7 @@ pub struct AssocFnWithoutBody {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::assoc_type_without_body)]
#[diag(ast_passes::assoc_type_without_body)]
pub struct AssocTypeWithoutBody {
#[primary_span]
pub span: Span,
Expand All @@ -187,7 +187,7 @@ pub struct AssocTypeWithoutBody {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::const_without_body)]
#[diag(ast_passes::const_without_body)]
pub struct ConstWithoutBody {
#[primary_span]
pub span: Span,
Expand All @@ -196,7 +196,7 @@ pub struct ConstWithoutBody {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::static_without_body)]
#[diag(ast_passes::static_without_body)]
pub struct StaticWithoutBody {
#[primary_span]
pub span: Span,
Expand All @@ -205,7 +205,7 @@ pub struct StaticWithoutBody {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::ty_alias_without_body)]
#[diag(ast_passes::ty_alias_without_body)]
pub struct TyAliasWithoutBody {
#[primary_span]
pub span: Span,
Expand All @@ -214,7 +214,7 @@ pub struct TyAliasWithoutBody {
}

#[derive(SessionDiagnostic)]
#[error(ast_passes::fn_without_body)]
#[diag(ast_passes::fn_without_body)]
pub struct FnWithoutBody {
#[primary_span]
pub span: Span,
Expand Down

0 comments on commit 09d495c

Please sign in to comment.