Repository navigation
Conversation
We catch any panics in `Runner::run_once`, and turn them into `Err` results. This prevents them from affecting the extraction of other files.
Also updates the remaining tests to use the new infallible interface.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Caught translation failures skip files without structured diagnostics, hiding missing analysis coverage, while the default panic hook emits stderr output outside tracing controls.
2 open issues
What changed in this PR
This PR isolates YEAST translation panics so a failing file can be skipped without terminating extraction. It also simplifies the translation APIs used by Swift desugaring.
Changes:
- Catch translation panics in the runner and return their messages as errors.
- Remove
Resultpropagation from translation APIs, macros, and Swift rules. - Update existing tests and add regression coverage for panic recovery.
| File | Description |
|---|---|
unified/extractor/src/languages/swift/swift.rs |
Adapt Swift rules to direct translation returns. |
shared/yeast/tests/test.rs |
Update API usage and test caught translation panics. |
shared/yeast/src/query.rs |
Return match booleans directly. |
shared/yeast/src/lib.rs |
Catch runner panics and simplify translation interfaces. |
shared/yeast/src/captures.rs |
Remove fallible capture-translation plumbing. |
shared/yeast/src/build.rs |
Simplify recursive translation and remove deferred errors. |
shared/yeast-macros/src/lower.rs |
Generate guards and transforms without Result wrappers. |
Review effort: Max
When `panic!` gets called, the default Rust panic handler prints out the error (and possibly a backtrace) to stderr. This means even if we handle the panics in `run_once`, we still get the printed output. To avoid this, we use `resume_unwind` (which foregoes the default behaviour) instead, and add a helper function called `translation_failure` that takes care of the places where translation could previously panic.
tausbn
marked this pull request as ready for review
November 6, 2026 13:06
This branch has not been deployed
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.


Adds a catcher for all panics that occur inside the desugaring runner. This prevents the panics from bubbling up to the top level and panicking the entire extraction. Instead, any panic just results in the file in question not being extracted.
With this handler in place, we can get rid of the use of
Resultin translations, for which theErrvariant was only used for unrecoverable errors anyway (which would then bubble up to the top of the runner and cause extraction for that file to fail). This makes the code a lot cleaner.Can be reviewed commit-by-commit. A DCA run has been started.