mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Remove AttributeLintKind::DocTestLiteral variant
This commit is contained in:
committed by
Jonathan Brouwer
parent
b1cc9a60d8
commit
33b896a067
@@ -15,9 +15,9 @@
|
||||
use crate::context::{AcceptContext, FinalizeContext, Stage};
|
||||
use crate::errors::{
|
||||
DocAliasDuplicated, DocAutoCfgExpectsHideOrShow, DocAutoCfgHideShowExpectsList,
|
||||
DocAutoCfgHideShowUnexpectedItem, DocAutoCfgWrongLiteral, DocTestTakesList, DocTestUnknown,
|
||||
DocUnknownAny, DocUnknownInclude, DocUnknownPasses, DocUnknownPlugins, DocUnknownSpotlight,
|
||||
IllFormedAttributeInput,
|
||||
DocAutoCfgHideShowUnexpectedItem, DocAutoCfgWrongLiteral, DocTestLiteral, DocTestTakesList,
|
||||
DocTestUnknown, DocUnknownAny, DocUnknownInclude, DocUnknownPasses, DocUnknownPlugins,
|
||||
DocUnknownSpotlight, IllFormedAttributeInput,
|
||||
};
|
||||
use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser};
|
||||
use crate::session_diagnostics::{
|
||||
@@ -224,9 +224,9 @@ fn parse_single_test_doc_attr_item<S: Stage>(
|
||||
);
|
||||
}
|
||||
None => {
|
||||
cx.emit_lint(
|
||||
cx.emit_dyn_lint(
|
||||
rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES,
|
||||
AttributeLintKind::DocTestLiteral,
|
||||
|dcx, level| DocTestLiteral.into_diag(dcx, level),
|
||||
path.span(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -263,6 +263,10 @@ pub(crate) struct DocTestUnknown {
|
||||
pub name: Symbol,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("`#![doc(test(...)]` does not take a literal")]
|
||||
pub(crate) struct DocTestLiteral;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("`#[diagnostic::on_const]` can only be applied to non-const trait implementations")]
|
||||
pub(crate) struct DiagnosticOnConstOnlyForTraitImpls {
|
||||
|
||||
@@ -43,8 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> {
|
||||
.into_diag(dcx, level)
|
||||
}
|
||||
|
||||
&AttributeLintKind::DocTestLiteral => lints::DocTestLiteral.into_diag(dcx, level),
|
||||
|
||||
&AttributeLintKind::AttrCrateLevelOnly => {
|
||||
lints::AttrCrateLevelOnly.into_diag(dcx, level)
|
||||
}
|
||||
|
||||
@@ -3303,10 +3303,6 @@ fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
|
||||
)]
|
||||
pub(crate) struct ExpectedNameValue;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("`#![doc(test(...)]` does not take a literal")]
|
||||
pub(crate) struct DocTestLiteral;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("this attribute can only be applied at the crate level")]
|
||||
#[note(
|
||||
|
||||
@@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind {
|
||||
pub enum AttributeLintKind {
|
||||
UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>),
|
||||
UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>),
|
||||
DocTestLiteral,
|
||||
AttrCrateLevelOnly,
|
||||
DoNotRecommendDoesNotExpectArgs,
|
||||
CrateTypeUnknown { span: Span, suggested: Option<Symbol> },
|
||||
|
||||
Reference in New Issue
Block a user