From 1e57ed26dbeef21f73f2c1537df60f8a018bb364 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 20 Apr 2026 16:35:32 +0200 Subject: [PATCH 1/5] Remove `AttributeLintKind::DocUnknownSpotlight` variant --- compiler/rustc_attr_parsing/src/attributes/doc.rs | 10 ++++++---- compiler/rustc_attr_parsing/src/errors.rs | 14 ++++++++++++++ compiler/rustc_lint/src/early/diagnostics.rs | 4 ---- compiler/rustc_lint/src/lints.rs | 14 -------------- compiler/rustc_lint_defs/src/lib.rs | 1 - 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/doc.rs b/compiler/rustc_attr_parsing/src/attributes/doc.rs index a5a9596a9e71..c39424f9e75d 100644 --- a/compiler/rustc_attr_parsing/src/attributes/doc.rs +++ b/compiler/rustc_attr_parsing/src/attributes/doc.rs @@ -15,7 +15,8 @@ use crate::context::{AcceptContext, FinalizeContext, Stage}; use crate::errors::{ DocAliasDuplicated, DocAutoCfgExpectsHideOrShow, DocAutoCfgHideShowExpectsList, - DocAutoCfgHideShowUnexpectedItem, DocUnknownInclude, IllFormedAttributeInput, + DocAutoCfgHideShowUnexpectedItem, DocUnknownInclude, DocUnknownSpotlight, + IllFormedAttributeInput, }; use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser}; use crate::session_diagnostics::{ @@ -613,10 +614,11 @@ macro_rules! string_arg_and_crate_level { } } Some(sym::spotlight) => { - cx.emit_lint( + let span = path.span(); + cx.emit_dyn_lint( rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, - AttributeLintKind::DocUnknownSpotlight { span: path.span() }, - path.span(), + move |dcx, level| DocUnknownSpotlight { sugg_span: span }.into_diag(dcx, level), + span, ); } Some(sym::include) if let Some(nv) = args.name_value() => { diff --git a/compiler/rustc_attr_parsing/src/errors.rs b/compiler/rustc_attr_parsing/src/errors.rs index 2ba50439c4e3..eb6c5aa202ad 100644 --- a/compiler/rustc_attr_parsing/src/errors.rs +++ b/compiler/rustc_attr_parsing/src/errors.rs @@ -205,3 +205,17 @@ pub(crate) struct DocUnknownInclude { )] pub sugg: (Span, Applicability), } + +#[derive(Diagnostic)] +#[diag("unknown `doc` attribute `spotlight`")] +#[note("`doc(spotlight)` was renamed to `doc(notable_trait)`")] +#[note("`doc(spotlight)` is now a no-op")] +pub(crate) struct DocUnknownSpotlight { + #[suggestion( + "use `notable_trait` instead", + style = "short", + applicability = "machine-applicable", + code = "notable_trait" + )] + pub sugg_span: Span, +} diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index a6a065040420..8d0bf5209493 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -43,10 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { .into_diag(dcx, level) } - &AttributeLintKind::DocUnknownSpotlight { span } => { - lints::DocUnknownSpotlight { sugg_span: span }.into_diag(dcx, level) - } - &AttributeLintKind::DocUnknownPasses { name, span } => { lints::DocUnknownPasses { name, note_span: span }.into_diag(dcx, level) } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 8912c8b03fbd..3910e45e5ec5 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3303,20 +3303,6 @@ fn add_to_diag(self, diag: &mut Diag<'_, G>) { )] pub(crate) struct ExpectedNameValue; -#[derive(Diagnostic)] -#[diag("unknown `doc` attribute `spotlight`")] -#[note("`doc(spotlight)` was renamed to `doc(notable_trait)`")] -#[note("`doc(spotlight)` is now a no-op")] -pub(crate) struct DocUnknownSpotlight { - #[suggestion( - "use `notable_trait` instead", - style = "short", - applicability = "machine-applicable", - code = "notable_trait" - )] - pub sugg_span: Span, -} - #[derive(Diagnostic)] #[diag("unknown `doc` attribute `{$name}`")] #[note( diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index 540e4afc50ff..13c3b4819ae8 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind { pub enum AttributeLintKind { UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>), UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>), - DocUnknownSpotlight { span: Span }, DocUnknownPasses { name: Symbol, span: Span }, DocUnknownPlugins { span: Span }, DocUnknownAny { name: Symbol }, From 7007737f1152cfae70a588a12576074ebcf5ceaa Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 20 Apr 2026 16:38:55 +0200 Subject: [PATCH 2/5] Remove `AttributeLintKind::DocUnknownPasses` variant --- compiler/rustc_attr_parsing/src/attributes/doc.rs | 11 +++++++---- compiler/rustc_attr_parsing/src/errors.rs | 12 ++++++++++++ compiler/rustc_lint/src/early/diagnostics.rs | 4 ---- compiler/rustc_lint/src/lints.rs | 12 ------------ compiler/rustc_lint_defs/src/lib.rs | 1 - 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/doc.rs b/compiler/rustc_attr_parsing/src/attributes/doc.rs index c39424f9e75d..9341e5e02be0 100644 --- a/compiler/rustc_attr_parsing/src/attributes/doc.rs +++ b/compiler/rustc_attr_parsing/src/attributes/doc.rs @@ -15,7 +15,7 @@ use crate::context::{AcceptContext, FinalizeContext, Stage}; use crate::errors::{ DocAliasDuplicated, DocAutoCfgExpectsHideOrShow, DocAutoCfgHideShowExpectsList, - DocAutoCfgHideShowUnexpectedItem, DocUnknownInclude, DocUnknownSpotlight, + DocAutoCfgHideShowUnexpectedItem, DocUnknownInclude, DocUnknownPasses, DocUnknownSpotlight, IllFormedAttributeInput, }; use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser}; @@ -642,10 +642,13 @@ macro_rules! string_arg_and_crate_level { ); } Some(name @ (sym::passes | sym::no_default_passes)) => { - cx.emit_lint( + let span = path.span(); + cx.emit_dyn_lint( rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, - AttributeLintKind::DocUnknownPasses { name, span: path.span() }, - path.span(), + move |dcx, level| { + DocUnknownPasses { name, note_span: span }.into_diag(dcx, level) + }, + span, ); } Some(sym::plugins) => { diff --git a/compiler/rustc_attr_parsing/src/errors.rs b/compiler/rustc_attr_parsing/src/errors.rs index eb6c5aa202ad..6b15157c4e2c 100644 --- a/compiler/rustc_attr_parsing/src/errors.rs +++ b/compiler/rustc_attr_parsing/src/errors.rs @@ -219,3 +219,15 @@ pub(crate) struct DocUnknownSpotlight { )] pub sugg_span: Span, } + +#[derive(Diagnostic)] +#[diag("unknown `doc` attribute `{$name}`")] +#[note( + "`doc` attribute `{$name}` no longer functions; see issue #44136 " +)] +#[note("`doc({$name})` is now a no-op")] +pub(crate) struct DocUnknownPasses { + pub name: Symbol, + #[label("no longer functions")] + pub note_span: Span, +} diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 8d0bf5209493..686e64a48de1 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -43,10 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { .into_diag(dcx, level) } - &AttributeLintKind::DocUnknownPasses { name, span } => { - lints::DocUnknownPasses { name, note_span: span }.into_diag(dcx, level) - } - &AttributeLintKind::DocUnknownPlugins { span } => { lints::DocUnknownPlugins { label_span: span }.into_diag(dcx, level) } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 3910e45e5ec5..08f78a36d1a5 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3303,18 +3303,6 @@ fn add_to_diag(self, diag: &mut Diag<'_, G>) { )] pub(crate) struct ExpectedNameValue; -#[derive(Diagnostic)] -#[diag("unknown `doc` attribute `{$name}`")] -#[note( - "`doc` attribute `{$name}` no longer functions; see issue #44136 " -)] -#[note("`doc({$name})` is now a no-op")] -pub(crate) struct DocUnknownPasses { - pub name: Symbol, - #[label("no longer functions")] - pub note_span: Span, -} - #[derive(Diagnostic)] #[diag("unknown `doc` attribute `plugins`")] #[note( diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index 13c3b4819ae8..417e7254bb52 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind { pub enum AttributeLintKind { UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>), UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>), - DocUnknownPasses { name: Symbol, span: Span }, DocUnknownPlugins { span: Span }, DocUnknownAny { name: Symbol }, DocAutoCfgWrongLiteral, From 0ad35a24fdb661758f27ae93eadd5636f80e1a20 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 20 Apr 2026 16:49:55 +0200 Subject: [PATCH 3/5] Remove `AttributeLintKind::DocUnknownPlugins` variant --- compiler/rustc_attr_parsing/src/attributes/doc.rs | 11 ++++++----- compiler/rustc_attr_parsing/src/errors.rs | 11 +++++++++++ compiler/rustc_lint/src/early/diagnostics.rs | 4 ---- compiler/rustc_lint/src/lints.rs | 11 ----------- compiler/rustc_lint_defs/src/lib.rs | 1 - 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/doc.rs b/compiler/rustc_attr_parsing/src/attributes/doc.rs index 9341e5e02be0..0f34977c93d2 100644 --- a/compiler/rustc_attr_parsing/src/attributes/doc.rs +++ b/compiler/rustc_attr_parsing/src/attributes/doc.rs @@ -15,8 +15,8 @@ use crate::context::{AcceptContext, FinalizeContext, Stage}; use crate::errors::{ DocAliasDuplicated, DocAutoCfgExpectsHideOrShow, DocAutoCfgHideShowExpectsList, - DocAutoCfgHideShowUnexpectedItem, DocUnknownInclude, DocUnknownPasses, DocUnknownSpotlight, - IllFormedAttributeInput, + DocAutoCfgHideShowUnexpectedItem, DocUnknownInclude, DocUnknownPasses, DocUnknownPlugins, + DocUnknownSpotlight, IllFormedAttributeInput, }; use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser}; use crate::session_diagnostics::{ @@ -652,10 +652,11 @@ macro_rules! string_arg_and_crate_level { ); } Some(sym::plugins) => { - cx.emit_lint( + let span = path.span(); + cx.emit_dyn_lint( rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, - AttributeLintKind::DocUnknownPlugins { span: path.span() }, - path.span(), + move |dcx, level| DocUnknownPlugins { label_span: span }.into_diag(dcx, level), + span, ); } Some(name) => { diff --git a/compiler/rustc_attr_parsing/src/errors.rs b/compiler/rustc_attr_parsing/src/errors.rs index 6b15157c4e2c..023ecf610666 100644 --- a/compiler/rustc_attr_parsing/src/errors.rs +++ b/compiler/rustc_attr_parsing/src/errors.rs @@ -231,3 +231,14 @@ pub(crate) struct DocUnknownPasses { #[label("no longer functions")] pub note_span: Span, } + +#[derive(Diagnostic)] +#[diag("unknown `doc` attribute `plugins`")] +#[note( + "`doc` attribute `plugins` no longer functions; see issue #44136 and CVE-2018-1000622 " +)] +#[note("`doc(plugins)` is now a no-op")] +pub(crate) struct DocUnknownPlugins { + #[label("no longer functions")] + pub label_span: Span, +} diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 686e64a48de1..779b4ca4ab16 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -43,10 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { .into_diag(dcx, level) } - &AttributeLintKind::DocUnknownPlugins { span } => { - lints::DocUnknownPlugins { label_span: span }.into_diag(dcx, level) - } - &AttributeLintKind::DocUnknownAny { name } => { lints::DocUnknownAny { name }.into_diag(dcx, level) } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 08f78a36d1a5..ac6fbcfdf518 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3303,17 +3303,6 @@ fn add_to_diag(self, diag: &mut Diag<'_, G>) { )] pub(crate) struct ExpectedNameValue; -#[derive(Diagnostic)] -#[diag("unknown `doc` attribute `plugins`")] -#[note( - "`doc` attribute `plugins` no longer functions; see issue #44136 and CVE-2018-1000622 " -)] -#[note("`doc(plugins)` is now a no-op")] -pub(crate) struct DocUnknownPlugins { - #[label("no longer functions")] - pub label_span: Span, -} - #[derive(Diagnostic)] #[diag("unknown `doc` attribute `{$name}`")] pub(crate) struct DocUnknownAny { diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index 417e7254bb52..8aadcbbd86ce 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind { pub enum AttributeLintKind { UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>), UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>), - DocUnknownPlugins { span: Span }, DocUnknownAny { name: Symbol }, DocAutoCfgWrongLiteral, DocTestTakesList, From 1aee0e07b4cdad1aa170c0873f5d93796f412351 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 20 Apr 2026 16:54:15 +0200 Subject: [PATCH 4/5] Remove `AttributeLintKind::DocUnknownAny` variant --- compiler/rustc_attr_parsing/src/attributes/doc.rs | 13 +++++++------ compiler/rustc_attr_parsing/src/errors.rs | 6 ++++++ compiler/rustc_lint/src/early/diagnostics.rs | 4 ---- compiler/rustc_lint/src/lints.rs | 6 ------ compiler/rustc_lint_defs/src/lib.rs | 1 - 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/doc.rs b/compiler/rustc_attr_parsing/src/attributes/doc.rs index 0f34977c93d2..ea3a2924d477 100644 --- a/compiler/rustc_attr_parsing/src/attributes/doc.rs +++ b/compiler/rustc_attr_parsing/src/attributes/doc.rs @@ -15,8 +15,8 @@ use crate::context::{AcceptContext, FinalizeContext, Stage}; use crate::errors::{ DocAliasDuplicated, DocAutoCfgExpectsHideOrShow, DocAutoCfgHideShowExpectsList, - DocAutoCfgHideShowUnexpectedItem, DocUnknownInclude, DocUnknownPasses, DocUnknownPlugins, - DocUnknownSpotlight, IllFormedAttributeInput, + DocAutoCfgHideShowUnexpectedItem, DocUnknownAny, DocUnknownInclude, DocUnknownPasses, + DocUnknownPlugins, DocUnknownSpotlight, IllFormedAttributeInput, }; use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser}; use crate::session_diagnostics::{ @@ -660,18 +660,19 @@ macro_rules! string_arg_and_crate_level { ); } Some(name) => { - cx.emit_lint( + cx.emit_dyn_lint( rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, - AttributeLintKind::DocUnknownAny { name }, + move |dcx, level| DocUnknownAny { name }.into_diag(dcx, level), path.span(), ); } None => { let full_name = path.segments().map(|s| s.as_str()).intersperse("::").collect::(); - cx.emit_lint( + let name = Symbol::intern(&full_name); + cx.emit_dyn_lint( rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, - AttributeLintKind::DocUnknownAny { name: Symbol::intern(&full_name) }, + move |dcx, level| DocUnknownAny { name }.into_diag(dcx, level), path.span(), ); } diff --git a/compiler/rustc_attr_parsing/src/errors.rs b/compiler/rustc_attr_parsing/src/errors.rs index 023ecf610666..dbbeacb5f1e4 100644 --- a/compiler/rustc_attr_parsing/src/errors.rs +++ b/compiler/rustc_attr_parsing/src/errors.rs @@ -242,3 +242,9 @@ pub(crate) struct DocUnknownPlugins { #[label("no longer functions")] pub label_span: Span, } + +#[derive(Diagnostic)] +#[diag("unknown `doc` attribute `{$name}`")] +pub(crate) struct DocUnknownAny { + pub name: Symbol, +} diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index 779b4ca4ab16..b1c75d0134d5 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -43,10 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { .into_diag(dcx, level) } - &AttributeLintKind::DocUnknownAny { name } => { - lints::DocUnknownAny { name }.into_diag(dcx, level) - } - &AttributeLintKind::DocAutoCfgWrongLiteral => { lints::DocAutoCfgWrongLiteral.into_diag(dcx, level) } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index ac6fbcfdf518..52403cc895dd 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3303,12 +3303,6 @@ fn add_to_diag(self, diag: &mut Diag<'_, G>) { )] pub(crate) struct ExpectedNameValue; -#[derive(Diagnostic)] -#[diag("unknown `doc` attribute `{$name}`")] -pub(crate) struct DocUnknownAny { - pub name: Symbol, -} - #[derive(Diagnostic)] #[diag("expected boolean for `#[doc(auto_cfg = ...)]`")] pub(crate) struct DocAutoCfgWrongLiteral; diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index 8aadcbbd86ce..cf26f8323341 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind { pub enum AttributeLintKind { UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>), UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>), - DocUnknownAny { name: Symbol }, DocAutoCfgWrongLiteral, DocTestTakesList, DocTestUnknown { name: Symbol }, From ea690c3d7b190047790dc9a64e68a3d7518b113e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 20 Apr 2026 16:59:14 +0200 Subject: [PATCH 5/5] Remove `AttributeLintKind::DocAutoCfgWrongLiteral` variant --- compiler/rustc_attr_parsing/src/attributes/doc.rs | 8 ++++---- compiler/rustc_attr_parsing/src/errors.rs | 4 ++++ compiler/rustc_lint/src/early/diagnostics.rs | 4 ---- compiler/rustc_lint/src/lints.rs | 4 ---- compiler/rustc_lint_defs/src/lib.rs | 1 - 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/doc.rs b/compiler/rustc_attr_parsing/src/attributes/doc.rs index ea3a2924d477..09d474a227fb 100644 --- a/compiler/rustc_attr_parsing/src/attributes/doc.rs +++ b/compiler/rustc_attr_parsing/src/attributes/doc.rs @@ -15,8 +15,8 @@ use crate::context::{AcceptContext, FinalizeContext, Stage}; use crate::errors::{ DocAliasDuplicated, DocAutoCfgExpectsHideOrShow, DocAutoCfgHideShowExpectsList, - DocAutoCfgHideShowUnexpectedItem, DocUnknownAny, DocUnknownInclude, DocUnknownPasses, - DocUnknownPlugins, DocUnknownSpotlight, IllFormedAttributeInput, + DocAutoCfgHideShowUnexpectedItem, DocAutoCfgWrongLiteral, DocUnknownAny, DocUnknownInclude, + DocUnknownPasses, DocUnknownPlugins, DocUnknownSpotlight, IllFormedAttributeInput, }; use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser}; use crate::session_diagnostics::{ @@ -443,9 +443,9 @@ fn parse_auto_cfg( ArgParser::NameValue(nv) => { let MetaItemLit { kind: LitKind::Bool(bool_value), span, .. } = nv.value_as_lit() else { - cx.emit_lint( + cx.emit_dyn_lint( rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, - AttributeLintKind::DocAutoCfgWrongLiteral, + move |dcx, level| DocAutoCfgWrongLiteral.into_diag(dcx, level), nv.value_span, ); return; diff --git a/compiler/rustc_attr_parsing/src/errors.rs b/compiler/rustc_attr_parsing/src/errors.rs index dbbeacb5f1e4..ca57c25f25a0 100644 --- a/compiler/rustc_attr_parsing/src/errors.rs +++ b/compiler/rustc_attr_parsing/src/errors.rs @@ -248,3 +248,7 @@ pub(crate) struct DocUnknownPlugins { pub(crate) struct DocUnknownAny { pub name: Symbol, } + +#[derive(Diagnostic)] +#[diag("expected boolean for `#[doc(auto_cfg = ...)]`")] +pub(crate) struct DocAutoCfgWrongLiteral; diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs index b1c75d0134d5..4a0320cbaf80 100644 --- a/compiler/rustc_lint/src/early/diagnostics.rs +++ b/compiler/rustc_lint/src/early/diagnostics.rs @@ -43,10 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { .into_diag(dcx, level) } - &AttributeLintKind::DocAutoCfgWrongLiteral => { - lints::DocAutoCfgWrongLiteral.into_diag(dcx, level) - } - &AttributeLintKind::DocTestTakesList => lints::DocTestTakesList.into_diag(dcx, level), &AttributeLintKind::DocTestUnknown { name } => { diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 52403cc895dd..19fabc51ae53 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -3303,10 +3303,6 @@ fn add_to_diag(self, diag: &mut Diag<'_, G>) { )] pub(crate) struct ExpectedNameValue; -#[derive(Diagnostic)] -#[diag("expected boolean for `#[doc(auto_cfg = ...)]`")] -pub(crate) struct DocAutoCfgWrongLiteral; - #[derive(Diagnostic)] #[diag("`#[doc(test(...)]` takes a list of attributes")] pub(crate) struct DocTestTakesList; diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index cf26f8323341..96c7dec3d818 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind { pub enum AttributeLintKind { UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>), UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>), - DocAutoCfgWrongLiteral, DocTestTakesList, DocTestUnknown { name: Symbol }, DocTestLiteral,