Check #[diagnostic::do_not_recommend] for arguments

This commit adds a check that verifies that no arguments are passed to
`#[diagnostic::do_not_recommend]`. If we detect arguments we emit a warning.
This commit is contained in:
Georg Semmler
2024-10-23 07:48:57 +02:00
parent bfd02d8b36
commit ecb6fd8d3a
6 changed files with 91 additions and 2 deletions

View File

@@ -20,6 +20,10 @@ use crate::lang_items::Duplicate;
#[diag(passes_incorrect_do_not_recommend_location)]
pub(crate) struct IncorrectDoNotRecommendLocation;
#[derive(LintDiagnostic)]
#[diag(passes_incorrect_do_not_recommend_args)]
pub(crate) struct DoNotRecommendDoesNotExpectArgs;
#[derive(Diagnostic)]
#[diag(passes_autodiff_attr)]
pub(crate) struct AutoDiffAttr {