1
Fork 0

Emit unused_attributes if a level attr only has a reason

This commit is contained in:
xFrednet 2022-03-03 22:28:56 +01:00
parent 10913c0001
commit 700ec66aed
No known key found for this signature in database
GPG key ID: FCDCBF29AF64D601
6 changed files with 133 additions and 41 deletions

View file

@ -258,7 +258,7 @@ impl<'s> LintLevelsBuilder<'s> {
};
if metas.is_empty() {
// FIXME (#55112): issue unused-attributes lint for `#[level()]`
// This emits the unused_attributes lint for `#[level()]`
continue;
}
@ -271,8 +271,6 @@ impl<'s> LintLevelsBuilder<'s> {
ast::MetaItemKind::Word => {} // actual lint names handled later
ast::MetaItemKind::NameValue(ref name_value) => {
if item.path == sym::reason {
// FIXME (#55112): issue unused-attributes lint if we thereby
// don't have any lint names (`#[level(reason = "foo")]`)
if let ast::LitKind::Str(rationale, _) = name_value.kind {
if !self.sess.features_untracked().lint_reasons {
feature_err(