Skip to content

fix(rewrite): inject Guard::check() after nested .await expressions#145

Merged
rocketman-code merged 1 commit intomainfrom
fix/nested-await-check
Feb 27, 2026
Merged

fix(rewrite): inject Guard::check() after nested .await expressions#145
rocketman-code merged 1 commit intomainfrom
fix/nested-await-check

Conversation

@rocketman-code
Copy link
Owner

Summary

  • Replace flat top-level iteration in inject_await_checks() with recursive VisitMut-based AwaitCheckInjector that processes blocks at every nesting depth
  • _piano_guard.check() is now injected immediately after each .await inside if, match, loop, while, for, and bare blocks — not after the enclosing top-level statement
  • 10 new unit tests covering all block types, multi-depth nesting, condition expressions, and closure/async-block exclusion

Closes #142

Test plan

  • All 129 unit tests pass
  • All integration tests pass
  • Clippy clean
  • cargo fmt --check clean

Replace flat top-level iteration in inject_await_checks() with recursive
VisitMut-based AwaitCheckInjector that processes blocks at every nesting
depth. check() is now injected immediately after each .await inside if,
match, loop, while, for, and bare blocks rather than after the enclosing
top-level statement.

Closes #142
@rocketman-code rocketman-code merged commit 0c6736d into main Feb 27, 2026
5 checks passed
@rocketman-code rocketman-code deleted the fix/nested-await-check branch February 27, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inject Guard::check() after nested .await expressions

1 participant