diff options
| author | Jhonny Bill Mena <jhonnybillm@gmail.com> | 2022-09-18 11:46:56 -0400 | 
|---|---|---|
| committer | Jhonny Bill Mena <jhonnybillm@gmail.com> | 2022-09-21 11:39:53 -0400 | 
| commit | a3396b207093c01065b63b0c58f1e6654629166d (patch) | |
| tree | 7d2b5bd979e9a1da8a2e10404676004876edc147 /compiler/rustc_lint/src | |
| parent | 191fac68266b73158ff048c83556ea91cbf977fd (diff) | |
| download | rust-a3396b207093c01065b63b0c58f1e6654629166d.tar.gz rust-a3396b207093c01065b63b0c58f1e6654629166d.zip | |
UPDATE - rename DiagnosticHandler macro to Diagnostic
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/errors.rs | 18 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/internal.rs | 4 | 
2 files changed, 11 insertions, 11 deletions
| diff --git a/compiler/rustc_lint/src/errors.rs b/compiler/rustc_lint/src/errors.rs index e5670833898..0c66ce475c4 100644 --- a/compiler/rustc_lint/src/errors.rs +++ b/compiler/rustc_lint/src/errors.rs @@ -1,9 +1,9 @@ use rustc_errors::{fluent, AddToDiagnostic, IntoDiagnostic, ErrorGuaranteed, Handler}; -use rustc_macros::{DiagnosticHandler, SessionSubdiagnostic}; +use rustc_macros::{Diagnostic, SessionSubdiagnostic}; use rustc_session::lint::Level; use rustc_span::{Span, Symbol}; -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::overruled_attribute, code = "E0453")] pub struct OverruledAttribute { #[primary_span] @@ -42,7 +42,7 @@ impl AddToDiagnostic for OverruledAttributeSub { } } -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::malformed_attribute, code = "E0452")] pub struct MalformedAttribute { #[primary_span] @@ -61,7 +61,7 @@ pub enum MalformedAttributeSub { ReasonMustComeLast(#[primary_span] Span), } -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::unknown_tool_in_scoped_lint, code = "E0710")] pub struct UnknownToolInScopedLint { #[primary_span] @@ -72,7 +72,7 @@ pub struct UnknownToolInScopedLint { pub is_nightly_build: Option<()>, } -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::builtin_ellipsis_inclusive_range_patterns, code = "E0783")] pub struct BuiltinEllpisisInclusiveRangePatterns { #[primary_span] @@ -107,7 +107,7 @@ impl AddToDiagnostic for RequestedLevel { } } -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::unsupported_group, code = "E0602")] pub struct UnsupportedGroup { pub lint_group: String, @@ -136,7 +136,7 @@ impl IntoDiagnostic<'_> for CheckNameUnknown { } } -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::check_name_unknown_tool, code = "E0602")] pub struct CheckNameUnknownTool { pub tool_name: Symbol, @@ -144,7 +144,7 @@ pub struct CheckNameUnknownTool { pub sub: RequestedLevel, } -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::check_name_warning)] pub struct CheckNameWarning { pub msg: String, @@ -152,7 +152,7 @@ pub struct CheckNameWarning { pub sub: RequestedLevel, } -#[derive(DiagnosticHandler)] +#[derive(Diagnostic)] #[diag(lint::check_name_deprecated)] pub struct CheckNameDeprecated { pub lint_name: String, diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index 47da8ec5da1..36d8ade22ae 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -372,7 +372,7 @@ declare_tool_lint! { declare_tool_lint! { pub rustc::DIAGNOSTIC_OUTSIDE_OF_IMPL, Allow, - "prevent creation of diagnostics outside of `DiagnosticHandler`/`AddToDiagnostic` impls", + "prevent creation of diagnostics outside of `IntoDiagnostic`/`AddToDiagnostic` impls", report_in_external_macro: true } @@ -404,7 +404,7 @@ impl LateLintPass<'_> for Diagnostics { let Impl { of_trait: Some(of_trait), .. } = impl_ && let Some(def_id) = of_trait.trait_def_id() && let Some(name) = cx.tcx.get_diagnostic_name(def_id) && - matches!(name, sym::DiagnosticHandler | sym::AddSubdiagnostic | sym::DecorateLint) + matches!(name, sym::Diagnostic | sym::AddSubdiagnostic | sym::DecorateLint) { found_impl = true; break; | 
