diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-06 22:02:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-06 22:02:46 +0100 |
| commit | efe9deace861039956aa182d8c17c38ef9ef2408 (patch) | |
| tree | b9854ba5f0310cbbc3dc518fadb2bb3d27785643 /compiler/rustc_feature | |
| parent | c7fca03240dfba93363505bc9c6839a224cc8ca6 (diff) | |
| parent | 3591e77b3566772023b7e35e96224106243ef214 (diff) | |
| download | rust-efe9deace861039956aa182d8c17c38ef9ef2408.tar.gz rust-efe9deace861039956aa182d8c17c38ef9ef2408.zip | |
Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco
Rework `untranslatable_diagnostic` lint
Currently it only checks calls to functions marked with `#[rustc_lint_diagnostics]`. This PR changes it to check calls to any function with an `impl Into<{D,Subd}iagnosticMessage>` parameter. This greatly improves its coverage and doesn't rely on people remembering to add `#[rustc_lint_diagnostics]`. It also lets us add `#[rustc_lint_diagnostics]` to a number of functions that don't have an `impl Into<{D,Subd}iagnosticMessage>`, such as `Diag::span`.
r? ``@davidtwco``
Diffstat (limited to 'compiler/rustc_feature')
| -rw-r--r-- | compiler/rustc_feature/src/builtin_attrs.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 3f971aad042..0d51e1e46e0 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -695,8 +695,8 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Used by the `rustc::potential_query_instability` lint to warn methods which // might not be stable during incremental compilation. rustc_attr!(rustc_lint_query_instability, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE), - // Used by the `rustc::untranslatable_diagnostic` and `rustc::diagnostic_outside_of_impl` lints - // to assist in changes to diagnostic APIs. + // Used by the `rustc::diagnostic_outside_of_impl` lints to assist in changes to diagnostic + // APIs. Any function with this attribute will be checked by that lint. rustc_attr!(rustc_lint_diagnostics, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE), // Used by the `rustc::bad_opt_access` lint to identify `DebuggingOptions` and `CodegenOptions` // types (as well as any others in future). |
