Skip to content

Commit 5f8d353

Browse files
authored
Rollup merge of rust-lang#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``
2 parents 124808b + 677c1d8 commit 5f8d353

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/parse/session.rs

+1
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ mod tests {
360360
}
361361

362362
fn build_diagnostic(level: DiagnosticLevel, span: Option<MultiSpan>) -> DiagInner {
363+
#[allow(rustc::untranslatable_diagnostic)] // no translation needed for empty string
363364
let mut diag = DiagInner::new(level, "");
364365
diag.messages.clear();
365366
if let Some(span) = span {

0 commit comments

Comments
 (0)