red_knot_python_semantic: remove Ranged impl for TypeCheckDiagnostic

It seems nothing is using it, and I'm not sure if it makes semantic
sense. Particularly if we want to support multiple ranges. One could
make an argument that this ought to correspond to the "primary"
range (which we should have), but I think such a concept is better
expressed as an explicit routine if possible.
This commit is contained in:
Andrew Gallant 2025-02-12 14:17:30 -05:00 committed by Andrew Gallant
parent e84985e9b3
commit 222660170c

View file

@ -11,7 +11,7 @@ use crate::{declare_lint, Db};
use ruff_db::diagnostic::{Diagnostic, DiagnosticId, Severity, Span}; use ruff_db::diagnostic::{Diagnostic, DiagnosticId, Severity, Span};
use ruff_db::files::File; use ruff_db::files::File;
use ruff_python_ast::{self as ast, AnyNodeRef}; use ruff_python_ast::{self as ast, AnyNodeRef};
use ruff_text_size::{Ranged, TextRange}; use ruff_text_size::TextRange;
use rustc_hash::FxHashSet; use rustc_hash::FxHashSet;
use std::borrow::Cow; use std::borrow::Cow;
use std::fmt::Formatter; use std::fmt::Formatter;
@ -811,12 +811,6 @@ impl Diagnostic for TypeCheckDiagnostic {
} }
} }
impl Ranged for TypeCheckDiagnostic {
fn range(&self) -> TextRange {
self.range
}
}
/// A collection of type check diagnostics. /// A collection of type check diagnostics.
/// ///
/// The diagnostics are wrapped in an `Arc` because they need to be cloned multiple times /// The diagnostics are wrapped in an `Arc` because they need to be cloned multiple times