mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Remove AttributeLintKind::DocUnknownPlugins variant
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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 <https://github.com/rust-lang/rust/issues/44136> and CVE-2018-1000622 <https://nvd.nist.gov/vuln/detail/CVE-2018-1000622>"
|
||||
)]
|
||||
#[note("`doc(plugins)` is now a no-op")]
|
||||
pub(crate) struct DocUnknownPlugins {
|
||||
#[label("no longer functions")]
|
||||
pub label_span: Span,
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -3303,17 +3303,6 @@ fn add_to_diag<G: EmissionGuarantee>(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 <https://github.com/rust-lang/rust/issues/44136> and CVE-2018-1000622 <https://nvd.nist.gov/vuln/detail/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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user