Skip to content
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

[naga] Remove ExpressionError::DoesntExist. #5762

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

jimblandy
Copy link
Member

Remove valid::expression::ExpressionError::DoesntExist. This error is reported
when expression validation encounters an invalid Handle<Expression>, but we
have already verified that the module is free of invalid handles in
Validator::validate_module_handles, so this condition should never arise.

Make BlockContext::resolve_pointer_type infallible.

Since BlockContext::resolve_pointer_type never returns an error,
change its result type from a Result to a &TypeInner. Adjust
callers accordingly.

Remove calls (well, there's only one) to resolve_pointer_type
entirely when the caller does not need the value, since
resolve_pointer_type is now infallible and has no side effects.

jimblandy added 2 commits May 31, 2024 16:14
Remove `valid::expression::ExpressionError::DoesntExist`. This error is reported
when expression validation encounters an invalid `Handle<Expression>`, but we
have already verified that the module is free of invalid handles in
`Validator::validate_module_handles`, so this condition should never arise.
Since `BlockContext::resolve_pointer_type` never returns an error,
change its result type from a `Result` to a `&TypeInner`. Adjust
callers accordingly.

Remove calls (well, there's only one) to `resolve_pointer_type`
entirely when the caller does not need the value, since
`resolve_pointer_type` is now infallible and has no side effects.
@jimblandy jimblandy added area: validation Issues related to validation, diagnostics, and error handling naga Shader Translator kind: refactor Making existing function faster or nicer labels May 31, 2024
@jimblandy jimblandy requested a review from a team as a code owner May 31, 2024 23:28
@jimblandy jimblandy requested a review from ErichDonGubler May 31, 2024 23:29
@teoxoy teoxoy merged commit badcaee into gfx-rs:trunk Jun 3, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Issues related to validation, diagnostics, and error handling kind: refactor Making existing function faster or nicer naga Shader Translator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants