mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-08 11:18:48 +00:00
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
8b0c347009
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
//! Compute the binary representation of a type
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
|
||||
use base_db::salsa::Cycle;
|
||||
|
@ -114,8 +115,8 @@ struct LayoutCx<'a> {
|
|||
impl<'a> LayoutCalculator for LayoutCx<'a> {
|
||||
type TargetDataLayoutRef = &'a TargetDataLayout;
|
||||
|
||||
fn delayed_bug(&self, txt: String) {
|
||||
never!("{}", txt);
|
||||
fn delayed_bug(&self, txt: impl Into<Cow<'static, str>>) {
|
||||
never!("{}", txt.into());
|
||||
}
|
||||
|
||||
fn current_data_layout(&self) -> &'a TargetDataLayout {
|
||||
|
|
Loading…
Reference in a new issue