diff options
| author | mejrs <59372212+mejrs@users.noreply.github.com> | 2025-07-11 01:24:24 +0200 |
|---|---|---|
| committer | mejrs <59372212+mejrs@users.noreply.github.com> | 2025-07-11 01:24:24 +0200 |
| commit | a7bf5c4fa2d83669511e88657c194edaec82a872 (patch) | |
| tree | 67e6da99a781bc01d5aced45cc13af2722cfc7c3 /compiler/rustc_passes/src | |
| parent | 25cf7d13c960a3ac47d1424ca354077efb6946ff (diff) | |
| download | rust-a7bf5c4fa2d83669511e88657c194edaec82a872.tar.gz rust-a7bf5c4fa2d83669511e88657c194edaec82a872.zip | |
Split up the `unknown_or_malformed_diagnostic_attributes` lint
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 9e4e78c1db6..87d66fcc7b6 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -33,7 +33,7 @@ use rustc_session::config::CrateType; use rustc_session::lint; use rustc_session::lint::builtin::{ CONFLICTING_REPR_HINTS, INVALID_DOC_ATTRIBUTES, INVALID_MACRO_EXPORT_ARGUMENTS, - UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, UNUSED_ATTRIBUTES, + MALFORMED_DIAGNOSTIC_ATTRIBUTES, MISPLACED_DIAGNOSTIC_ATTRIBUTES, UNUSED_ATTRIBUTES, }; use rustc_session::parse::feature_err; use rustc_span::edition::Edition; @@ -442,7 +442,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> { ); } - /// Checks if `#[diagnostic::do_not_recommend]` is applied on a trait impl. + /// Checks if `#[diagnostic::do_not_recommend]` is applied on a trait impl and that it has no + /// arguments. fn check_do_not_recommend( &self, attr_span: Span, @@ -459,7 +460,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { ) { self.tcx.emit_node_span_lint( - UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, + MISPLACED_DIAGNOSTIC_ATTRIBUTES, hir_id, attr_span, errors::IncorrectDoNotRecommendLocation, @@ -467,7 +468,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } if !attr.is_word() { self.tcx.emit_node_span_lint( - UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, + MALFORMED_DIAGNOSTIC_ATTRIBUTES, hir_id, attr_span, errors::DoNotRecommendDoesNotExpectArgs, @@ -479,7 +480,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { fn check_diagnostic_on_unimplemented(&self, attr_span: Span, hir_id: HirId, target: Target) { if !matches!(target, Target::Trait) { self.tcx.emit_node_span_lint( - UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, + MISPLACED_DIAGNOSTIC_ATTRIBUTES, hir_id, attr_span, DiagnosticOnUnimplementedOnlyForTraits, |
