diff --git a/crates/ruff_db/src/diagnostic.rs b/crates/ruff_db/src/diagnostic.rs index 20b04bcb22..4b3be76ab9 100644 --- a/crates/ruff_db/src/diagnostic.rs +++ b/crates/ruff_db/src/diagnostic.rs @@ -375,6 +375,50 @@ impl Diagnostic for Box { } } +impl Diagnostic for &'_ dyn Diagnostic { + fn id(&self) -> DiagnosticId { + (**self).id() + } + + fn message(&self) -> Cow { + (**self).message() + } + + fn file(&self) -> Option { + (**self).file() + } + + fn range(&self) -> Option { + (**self).range() + } + + fn severity(&self) -> Severity { + (**self).severity() + } +} + +impl Diagnostic for std::sync::Arc { + fn id(&self) -> DiagnosticId { + (**self).id() + } + + fn message(&self) -> Cow { + (**self).message() + } + + fn file(&self) -> Option { + (**self).file() + } + + fn range(&self) -> Option { + (**self).range() + } + + fn severity(&self) -> Severity { + (**self).severity() + } +} + #[derive(Debug)] pub struct ParseDiagnostic { file: File,