Skip to content

[naga] Allow unreachable statements after return/break/continue/discard #7718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

andyleiserson
Copy link
Contributor

Fixes #7536

This is an alternative to #7554, which generates a warning on unreachable statements. Reasons to take this simpler change instead are that the diagnostic infrastructure is not mature yet, and it is likely that eventual fixes to uniformity analysis (#4369) will also need to consider unreachable statements, so it may make more sense to emit an unreachable statements diagnostic from within the uniformity analysis implementation.

Testing
Adds a test that an unreachable statement after return is permitted and still contributes to global use. Also enables some relevant CTS tests.

Squash or Rebase? Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

Allow unreachable statements after return/break/continue/discard.

Fixes gfx-rs#7536
@andyleiserson andyleiserson requested review from crowlKats and a team as code owners May 23, 2025 16:46
@andyleiserson andyleiserson added the PR: run CTS PRs that should trigger the GitHub actions workflow for the WebGPU conformance test suite (CTS) label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: run CTS PRs that should trigger the GitHub actions workflow for the WebGPU conformance test suite (CTS)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Instructions after return" is reported incorrectly
1 participant