Skip to content

Commit 257cf03

Browse files
committed
refactor: migrate to kind-less SessionDiagnostic derives
1 parent 1974186 commit 257cf03

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compiler/rustc_lint/src/errors.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_session::{lint::Level, parse::ParseSess, SessionDiagnostic};
44
use rustc_span::{Span, Symbol};
55

66
#[derive(SessionDiagnostic)]
7-
#[error(lint::overruled_attribute, code = "E0453")]
7+
#[diag(lint::overruled_attribute, code = "E0453")]
88
pub struct OverruledAttribute {
99
#[primary_span]
1010
pub span: Span,
@@ -43,7 +43,7 @@ impl AddSubdiagnostic for OverruledAttributeSub {
4343
}
4444

4545
#[derive(SessionDiagnostic)]
46-
#[error(lint::malformed_attribute, code = "E0452")]
46+
#[diag(lint::malformed_attribute, code = "E0452")]
4747
pub struct MalformedAttribute {
4848
#[primary_span]
4949
pub span: Span,
@@ -62,7 +62,7 @@ pub enum MalformedAttributeSub {
6262
}
6363

6464
#[derive(SessionDiagnostic)]
65-
#[error(lint::unknown_tool_in_scoped_lint, code = "E0710")]
65+
#[diag(lint::unknown_tool_in_scoped_lint, code = "E0710")]
6666
pub struct UnknownToolInScopedLint {
6767
#[primary_span]
6868
pub span: Option<Span>,
@@ -73,7 +73,7 @@ pub struct UnknownToolInScopedLint {
7373
}
7474

7575
#[derive(SessionDiagnostic)]
76-
#[error(lint::builtin_ellipsis_inclusive_range_patterns, code = "E0783")]
76+
#[diag(lint::builtin_ellipsis_inclusive_range_patterns, code = "E0783")]
7777
pub struct BuiltinEllpisisInclusiveRangePatterns {
7878
#[primary_span]
7979
pub span: Span,
@@ -108,7 +108,7 @@ impl AddSubdiagnostic for RequestedLevel {
108108
}
109109

110110
#[derive(SessionDiagnostic)]
111-
#[error(lint::unsupported_group, code = "E0602")]
111+
#[diag(lint::unsupported_group, code = "E0602")]
112112
pub struct UnsupportedGroup {
113113
pub lint_group: String,
114114
}
@@ -137,23 +137,23 @@ impl SessionDiagnostic<'_> for CheckNameUnknown {
137137
}
138138

139139
#[derive(SessionDiagnostic)]
140-
#[error(lint::check_name_unknown_tool, code = "E0602")]
140+
#[diag(lint::check_name_unknown_tool, code = "E0602")]
141141
pub struct CheckNameUnknownTool {
142142
pub tool_name: Symbol,
143143
#[subdiagnostic]
144144
pub sub: RequestedLevel,
145145
}
146146

147147
#[derive(SessionDiagnostic)]
148-
#[warning(lint::check_name_warning)]
148+
#[diag(lint::check_name_warning)]
149149
pub struct CheckNameWarning {
150150
pub msg: String,
151151
#[subdiagnostic]
152152
pub sub: RequestedLevel,
153153
}
154154

155155
#[derive(SessionDiagnostic)]
156-
#[warning(lint::check_name_deprecated)]
156+
#[diag(lint::check_name_deprecated)]
157157
pub struct CheckNameDeprecated {
158158
pub lint_name: String,
159159
pub new_name: String,

0 commit comments

Comments
 (0)