mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Remove AttributeLintKind::DoNotRecommendDoesNotExpectArgs variant
This commit is contained in:
committed by
Jonathan Brouwer
parent
a9f16fa646
commit
6b782884e7
@@ -2,7 +2,6 @@
|
||||
use rustc_feature::{AttributeTemplate, template};
|
||||
use rustc_hir::Target;
|
||||
use rustc_hir::attrs::AttributeKind;
|
||||
use rustc_hir::lints::AttributeLintKind;
|
||||
use rustc_session::lint::builtin::{
|
||||
MALFORMED_DIAGNOSTIC_ATTRIBUTES, MISPLACED_DIAGNOSTIC_ATTRIBUTES,
|
||||
};
|
||||
@@ -25,9 +24,9 @@ impl<S: Stage> SingleAttributeParser<S> for DoNotRecommendParser {
|
||||
fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option<AttributeKind> {
|
||||
let attr_span = cx.attr_span;
|
||||
if !matches!(args, ArgParser::NoArgs) {
|
||||
cx.emit_lint(
|
||||
cx.emit_dyn_lint(
|
||||
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
|
||||
AttributeLintKind::DoNotRecommendDoesNotExpectArgs,
|
||||
|dcx, level| crate::errors::DoNotRecommendDoesNotExpectArgs.into_diag(dcx, level),
|
||||
attr_span,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -274,6 +274,10 @@ pub(crate) struct DocTestUnknown {
|
||||
)]
|
||||
pub(crate) struct AttrCrateLevelOnly;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("`#[diagnostic::do_not_recommend]` does not expect any arguments")]
|
||||
pub(crate) struct DoNotRecommendDoesNotExpectArgs;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("`#[diagnostic::on_const]` can only be applied to non-const trait implementations")]
|
||||
pub(crate) struct DiagnosticOnConstOnlyForTraitImpls {
|
||||
|
||||
@@ -43,10 +43,6 @@ fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> {
|
||||
.into_diag(dcx, level)
|
||||
}
|
||||
|
||||
&AttributeLintKind::DoNotRecommendDoesNotExpectArgs => {
|
||||
lints::DoNotRecommendDoesNotExpectArgs.into_diag(dcx, level)
|
||||
}
|
||||
|
||||
&AttributeLintKind::CrateTypeUnknown { span, suggested } => lints::UnknownCrateTypes {
|
||||
sugg: suggested.map(|s| lints::UnknownCrateTypesSuggestion { span, snippet: s }),
|
||||
}
|
||||
|
||||
@@ -3303,10 +3303,6 @@ fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
|
||||
)]
|
||||
pub(crate) struct ExpectedNameValue;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("`#[diagnostic::do_not_recommend]` does not expect any arguments")]
|
||||
pub(crate) struct DoNotRecommendDoesNotExpectArgs;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag("invalid `crate_type` value")]
|
||||
pub(crate) struct UnknownCrateTypes {
|
||||
|
||||
@@ -656,7 +656,6 @@ pub enum DeprecatedSinceKind {
|
||||
pub enum AttributeLintKind {
|
||||
UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>),
|
||||
UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>),
|
||||
DoNotRecommendDoesNotExpectArgs,
|
||||
CrateTypeUnknown { span: Span, suggested: Option<Symbol> },
|
||||
MalformedDoc,
|
||||
ExpectedNoArgs,
|
||||
|
||||
Reference in New Issue
Block a user