mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Remove AttributeLintKind::MalformedDoc variant
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
DocAutoCfgHideShowExpectsList, DocAutoCfgHideShowUnexpectedItem, DocAutoCfgWrongLiteral,
|
||||
DocTestLiteral, DocTestTakesList, DocTestUnknown, DocUnknownAny, DocUnknownInclude,
|
||||
DocUnknownPasses, DocUnknownPlugins, DocUnknownSpotlight, IllFormedAttributeInput,
|
||||
MalformedDoc,
|
||||
};
|
||||
use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser};
|
||||
use crate::session_diagnostics::{
|
||||
@@ -107,9 +108,9 @@ fn expected_string_literal<S: Stage>(
|
||||
span: Span,
|
||||
_actual_literal: Option<&MetaItemLit>,
|
||||
) {
|
||||
cx.emit_lint(
|
||||
cx.emit_dyn_lint(
|
||||
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
|
||||
AttributeLintKind::MalformedDoc,
|
||||
|dcx, level| MalformedDoc.into_diag(dcx, level),
|
||||
span,
|
||||
);
|
||||
}
|
||||
@@ -203,9 +204,9 @@ fn parse_single_test_doc_attr_item<S: Stage>(
|
||||
// FIXME: remove this method once merged and uncomment the line below instead.
|
||||
// cx.expected_list(cx.attr_span, args);
|
||||
let span = cx.attr_span;
|
||||
cx.emit_lint(
|
||||
cx.emit_dyn_lint(
|
||||
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
|
||||
AttributeLintKind::MalformedDoc,
|
||||
|dcx, level| MalformedDoc.into_diag(dcx, level),
|
||||
span,
|
||||
);
|
||||
return;
|
||||
@@ -399,9 +400,9 @@ fn parse_auto_cfg<S: Stage>(
|
||||
// FIXME: remove this method once merged and uncomment the line
|
||||
// below instead.
|
||||
// cx.expected_identifier(sub_item.path().span());
|
||||
cx.emit_lint(
|
||||
cx.emit_dyn_lint(
|
||||
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
|
||||
AttributeLintKind::MalformedDoc,
|
||||
|dcx, level| MalformedDoc.into_diag(dcx, level),
|
||||
sub_item.path().span(),
|
||||
);
|
||||
continue;
|
||||
@@ -605,9 +606,9 @@ macro_rules! string_arg_and_crate_level {
|
||||
// FIXME: remove this method once merged and uncomment the line
|
||||
// below instead.
|
||||
// cx.unexpected_literal(lit.span);
|
||||
cx.emit_lint(
|
||||
cx.emit_dyn_lint(
|
||||
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
|
||||
AttributeLintKind::MalformedDoc,
|
||||
|dcx, level| MalformedDoc.into_diag(dcx, level),
|
||||
lit.span,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -325,3 +325,10 @@ pub(crate) struct IncorrectDoNotRecommendLocation {
|
||||
#[label("not a trait implementation")]
|
||||
pub target_span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("malformed `doc` attribute input")]
|
||||
#[warning(
|
||||
"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!"
|
||||
)]
|
||||
pub(crate) struct MalformedDoc;
|
||||
|
||||
@@ -43,8 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> {
|
||||
.into_diag(dcx, level)
|
||||
}
|
||||
|
||||
&AttributeLintKind::MalformedDoc => lints::MalformedDoc.into_diag(dcx, level),
|
||||
|
||||
&AttributeLintKind::ExpectedNoArgs => lints::ExpectedNoArgs.into_diag(dcx, level),
|
||||
|
||||
&AttributeLintKind::ExpectedNameValue => lints::ExpectedNameValue.into_diag(dcx, level),
|
||||
|
||||
@@ -3282,13 +3282,6 @@ fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("malformed `doc` attribute input")]
|
||||
#[warning(
|
||||
"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!"
|
||||
)]
|
||||
pub(crate) struct MalformedDoc;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("didn't expect any arguments here")]
|
||||
#[warning(
|
||||
|
||||
@@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind {
|
||||
pub enum AttributeLintKind {
|
||||
UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>),
|
||||
UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>),
|
||||
MalformedDoc,
|
||||
ExpectedNoArgs,
|
||||
ExpectedNameValue,
|
||||
MalFormedDiagnosticAttribute { attribute: &'static str, options: &'static str, span: Span },
|
||||
|
||||
Reference in New Issue
Block a user