Issue Description
Validation of span order only occurs in debug builds.
Since validation only happens in debug builds, invalid spans may go undetected in release builds, potentially causing bugs. Consider enabling validation in release builds, either always or via a feature flag.
Location
src/parser/cst_builder/spans.rs:98
Code Context
/// Build the [`ParsedSpans`].
#[must_use]
pub fn build(self) -> ParsedSpans {
let Self {
imports,
Suggested Implementation
let result = validate_span_lists_sorted(&[
("imports", &imports),
// ... other fields
]);
if let Err(e) = result {
panic!("Span order validation failed: {e}");
}
References
Issue Description
Validation of span order only occurs in debug builds.
Since validation only happens in debug builds, invalid spans may go undetected in release builds, potentially causing bugs. Consider enabling validation in release builds, either always or via a feature flag.
Location
src/parser/cst_builder/spans.rs:98Code Context
Suggested Implementation
References