diff --git a/crates/red_knot_python_semantic/src/types/diagnostic.rs b/crates/red_knot_python_semantic/src/types/diagnostic.rs index 1877bf7de4..067f3d4f76 100644 --- a/crates/red_knot_python_semantic/src/types/diagnostic.rs +++ b/crates/red_knot_python_semantic/src/types/diagnostic.rs @@ -17,7 +17,6 @@ use ruff_text_size::{Ranged, TextRange}; use rustc_hash::FxHashSet; use std::borrow::Cow; use std::fmt::Formatter; -use std::ops::Deref; use std::sync::Arc; /// Registers all known type check lints. @@ -985,6 +984,10 @@ impl TypeCheckDiagnostics { self.used_suppressions.shrink_to_fit(); self.diagnostics.shrink_to_fit(); } + + pub fn iter(&self) -> std::slice::Iter<'_, Arc> { + self.diagnostics.iter() + } } impl std::fmt::Debug for TypeCheckDiagnostics { @@ -993,14 +996,6 @@ impl std::fmt::Debug for TypeCheckDiagnostics { } } -impl Deref for TypeCheckDiagnostics { - type Target = [std::sync::Arc]; - - fn deref(&self) -> &Self::Target { - &self.diagnostics - } -} - impl IntoIterator for TypeCheckDiagnostics { type Item = Arc; type IntoIter = std::vec::IntoIter>;