Skip to content

Commit

Permalink
refactor: migrate to kind-less SessionDiagnostic derives
Browse files Browse the repository at this point in the history
  • Loading branch information
Rejyr committed Aug 22, 2022
1 parent 1974186 commit 257cf03
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions compiler/rustc_lint/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc_session::{lint::Level, parse::ParseSess, SessionDiagnostic};
use rustc_span::{Span, Symbol};

#[derive(SessionDiagnostic)]
#[error(lint::overruled_attribute, code = "E0453")]
#[diag(lint::overruled_attribute, code = "E0453")]
pub struct OverruledAttribute {
#[primary_span]
pub span: Span,
Expand Down Expand Up @@ -43,7 +43,7 @@ impl AddSubdiagnostic for OverruledAttributeSub {
}

#[derive(SessionDiagnostic)]
#[error(lint::malformed_attribute, code = "E0452")]
#[diag(lint::malformed_attribute, code = "E0452")]
pub struct MalformedAttribute {
#[primary_span]
pub span: Span,
Expand All @@ -62,7 +62,7 @@ pub enum MalformedAttributeSub {
}

#[derive(SessionDiagnostic)]
#[error(lint::unknown_tool_in_scoped_lint, code = "E0710")]
#[diag(lint::unknown_tool_in_scoped_lint, code = "E0710")]
pub struct UnknownToolInScopedLint {
#[primary_span]
pub span: Option<Span>,
Expand All @@ -73,7 +73,7 @@ pub struct UnknownToolInScopedLint {
}

#[derive(SessionDiagnostic)]
#[error(lint::builtin_ellipsis_inclusive_range_patterns, code = "E0783")]
#[diag(lint::builtin_ellipsis_inclusive_range_patterns, code = "E0783")]
pub struct BuiltinEllpisisInclusiveRangePatterns {
#[primary_span]
pub span: Span,
Expand Down Expand Up @@ -108,7 +108,7 @@ impl AddSubdiagnostic for RequestedLevel {
}

#[derive(SessionDiagnostic)]
#[error(lint::unsupported_group, code = "E0602")]
#[diag(lint::unsupported_group, code = "E0602")]
pub struct UnsupportedGroup {
pub lint_group: String,
}
Expand Down Expand Up @@ -137,23 +137,23 @@ impl SessionDiagnostic<'_> for CheckNameUnknown {
}

#[derive(SessionDiagnostic)]
#[error(lint::check_name_unknown_tool, code = "E0602")]
#[diag(lint::check_name_unknown_tool, code = "E0602")]
pub struct CheckNameUnknownTool {
pub tool_name: Symbol,
#[subdiagnostic]
pub sub: RequestedLevel,
}

#[derive(SessionDiagnostic)]
#[warning(lint::check_name_warning)]
#[diag(lint::check_name_warning)]
pub struct CheckNameWarning {
pub msg: String,
#[subdiagnostic]
pub sub: RequestedLevel,
}

#[derive(SessionDiagnostic)]
#[warning(lint::check_name_deprecated)]
#[diag(lint::check_name_deprecated)]
pub struct CheckNameDeprecated {
pub lint_name: String,
pub new_name: String,
Expand Down

0 comments on commit 257cf03

Please sign in to comment.