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``
This commit is contained in:
commit
efe9deace8
42 changed files with 305 additions and 89 deletions
|
@ -168,6 +168,7 @@ pub fn add_feature_diagnostics<G: EmissionGuarantee>(
|
|||
/// This variant allows you to control whether it is a library or language feature.
|
||||
/// Almost always, you want to use this for a language feature. If so, prefer
|
||||
/// `add_feature_diagnostics`.
|
||||
#[allow(rustc::diagnostic_outside_of_impl)] // FIXME
|
||||
pub fn add_feature_diagnostics_for_issue<G: EmissionGuarantee>(
|
||||
err: &mut Diag<'_, G>,
|
||||
sess: &Session,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue