Remove AttributeLintKind::DocUnknownPasses variant

This commit is contained in:
Guillaume Gomez
2026-04-20 16:38:55 +02:00
parent 1e57ed26db
commit 7007737f11
5 changed files with 19 additions and 21 deletions
@@ -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) => {
+12
View File
@@ -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 <https://github.com/rust-lang/rust/issues/44136>"
)]
#[note("`doc({$name})` is now a no-op")]
pub(crate) struct DocUnknownPasses {
pub name: Symbol,
#[label("no longer functions")]
pub note_span: Span,
}
@@ -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)
}
-12
View File
@@ -3303,18 +3303,6 @@ fn add_to_diag<G: EmissionGuarantee>(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 <https://github.com/rust-lang/rust/issues/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(
-1
View File
@@ -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,