Repository navigation
fix(driver): drop the unreachable retained-source validation fallback - #628
Merged
Merged
Conversation
workshop-rs 1.13's set_file_source prunes provenance spans that do not resolve in the attached document, and the only source-dependent validate check runs on spans pruning already removed; a remaining validate() failure is source-independent, so the unretained re-parse could only re-surface the same error. The fallback, the retained_source flag, and the source-map-span-overflow warning are removed; validation errors now return directly. The span-pruning regression test keeps its assert and gains the new issue reference. Fixes #626
e54-bot
commented
Oct 11, 2026
e54-bot
left a comment
Collaborator
Author
There was a problem hiding this comment.
Independent review — LGTM. Verified unreachability end to end: SourceMap::apply rebinds the file table, bounds/validates all mapped spans, and settings.clear_spans() covers the non-provenance spans; set_file_source's prune_spans_outside covers every provenance slot; to_wir sources WIR spans only from provenance; check_span's byte_range is the only source-dependent check and runs only for files with attached source, where post-prune all spans resolve. The !retained_source early-return is equivalent to the new error path (same &source_files-iff-Mapped argument). No dangling source-map-span-overflow references, no dead imports; test comment accurate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the #583 retained-source recovery fallback in
session.rs, which #626 shows is unreachable after the workshop-rs 1.13 bump (#624/#625):set_file_sourceprunes provenance spans that do not resolve in the attached document, and the only source-dependentvalidate()check (wir/validate.rsbyte_range) runs on spans pruning already removed. A remainingvalidate()failure is therefore source-independent — the unretained re-parse could only re-surface the same error, never recover.map.applyre-application,retained_sourceflag, and thesource-map-span-overflowwarningworkshop_diag_for_provider_artifactdirectlyMappedprovenance still survives) and its doc gains Remove the now-unreachable retained-source validation fallback in session.rs #626Test plan
cargo test -p wright-driver --test source_provider— 37/37, includingmapped_span_outside_retained_source_degrades_extents_not_the_loadcargo fmt --all -- --check,git diff --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-targets --all-features— full workspace greengit grep source-map-span-overflow— no remaining referencesFixes #626