mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
[naga] Remove ExpressionError::DoesntExist
.
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.
This commit is contained in:
parent
91e4be314c
commit
049db89039
@ -12,8 +12,6 @@ use crate::{
|
||||
#[derive(Clone, Debug, thiserror::Error)]
|
||||
#[cfg_attr(test, derive(PartialEq))]
|
||||
pub enum ExpressionError {
|
||||
#[error("Doesn't exist")]
|
||||
DoesntExist,
|
||||
#[error("Used by a statement before it was introduced into the scope by any of the dominating blocks")]
|
||||
NotInScope,
|
||||
#[error("Base type {0:?} is not compatible with this expression")]
|
||||
|
@ -241,9 +241,7 @@ impl<'a> BlockContext<'a> {
|
||||
handle: Handle<crate::Expression>,
|
||||
valid_expressions: &BitSet,
|
||||
) -> Result<&crate::TypeInner, WithSpan<ExpressionError>> {
|
||||
if handle.index() >= self.expressions.len() {
|
||||
Err(ExpressionError::DoesntExist.with_span())
|
||||
} else if !valid_expressions.contains(handle.index()) {
|
||||
if !valid_expressions.contains(handle.index()) {
|
||||
Err(ExpressionError::NotInScope.with_span_handle(handle, self.expressions))
|
||||
} else {
|
||||
Ok(self.info[handle].ty.inner_with(self.types))
|
||||
@ -263,14 +261,7 @@ impl<'a> BlockContext<'a> {
|
||||
&self,
|
||||
handle: Handle<crate::Expression>,
|
||||
) -> Result<&crate::TypeInner, FunctionError> {
|
||||
if handle.index() >= self.expressions.len() {
|
||||
Err(FunctionError::Expression {
|
||||
handle,
|
||||
source: ExpressionError::DoesntExist,
|
||||
})
|
||||
} else {
|
||||
Ok(self.info[handle].ty.inner_with(self.types))
|
||||
}
|
||||
Ok(self.info[handle].ty.inner_with(self.types))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user