Skip to content

Conversation

@andyleiserson
Copy link
Contributor

Fixes #8711

After #7339, some valid const expressions would be rejected because the LHS does not resolve directly to an ir::Literal. This fixes that by using proper expression "evaluation" machinery. (I put evaluation in quotes, because it seems more like a lookup to me -- it's just retrieving already-resolved constant values.)

There is a bunch of duplication in the eval_expr_to_{u32,bool} code, but I decided not to try and refactor that at the same time as fixing a regression.

Testing
Enables some CTS tests and updates some snapshots 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.

@jimblandy jimblandy self-requested a review December 17, 2025 16:11
@cwfitzgerald cwfitzgerald mentioned this pull request Dec 17, 2025
Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the fix!

@jimblandy jimblandy merged commit c5e460f into gfx-rs:trunk Dec 17, 2025
47 checks passed
@andyleiserson andyleiserson deleted the push-spltruwzwkmz branch December 17, 2025 22:03
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.

Naga short-circuit fix regresses some type checking

2 participants