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 | 5f8d353fe1ea01df5b7dcbf73190b5528568eb94 (patch) | |
| tree | d30ae0a0d774eccc5da52cd844d8cf02f5dbbb3f | |
| parent | 124808b5828cd9ee0a17a46c706c3cd55705336c (diff) | |
| parent | 677c1d805906bcd21f0dd48d044fee9323db7e74 (diff) | |
| download | rust-5f8d353fe1ea01df5b7dcbf73190b5528568eb94.tar.gz rust-5f8d353fe1ea01df5b7dcbf73190b5528568eb94.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``
| -rw-r--r-- | src/parse/session.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/parse/session.rs b/src/parse/session.rs index 60a89a57536..cb46e65999d 100644 --- a/src/parse/session.rs +++ b/src/parse/session.rs @@ -360,6 +360,7 @@ mod tests { } fn build_diagnostic(level: DiagnosticLevel, span: Option<MultiSpan>) -> DiagInner { + #[allow(rustc::untranslatable_diagnostic)] // no translation needed for empty string let mut diag = DiagInner::new(level, ""); diag.messages.clear(); if let Some(span) = span { |
