Skip to content

Commit b5587ee

Browse files
TODO: narrow spans for more ExpressionError cases?
1 parent 390beed commit b5587ee

1 file changed

Lines changed: 29 additions & 19 deletions

File tree

naga/src/valid/expression.rs

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,24 @@ impl ExpressionError {
153153
Self::InvalidBaseType(handle) => just(handle),
154154
Self::InvalidIndexType(handle) => just(handle),
155155
Self::NegativeIndex(handle) => just(handle),
156-
Self::IndexOutOfBounds(..) => Vec::new(),
156+
Self::IndexOutOfBounds(handle, _) => Vec::new(),
157157
Self::FunctionArgumentDoesntExist(..) => Vec::new(),
158158
Self::InvalidPointerType(handle) => just(handle),
159159
Self::InvalidArrayType(handle) => just(handle),
160160
Self::InvalidRayQueryType(handle) => just(handle),
161161
Self::InvalidSplatType(handle) => just(handle),
162162
Self::InvalidVectorType(handle) => just(handle),
163-
Self::InvalidSwizzleComponent(..) => Vec::new(),
164-
Self::Compose(..) => Vec::new(),
165-
Self::IndexableLength(..) => Vec::new(),
163+
Self::InvalidSwizzleComponent(swizzle_component, vector_size) => Vec::new(),
164+
Self::Compose(ref compose_error) => Vec::new(),
165+
Self::IndexableLength(indexable_length_error) => Vec::new(),
166166
Self::InvalidUnaryOperandType(_unary_operator, handle) => just(handle),
167-
Self::InvalidBinaryOperandTypes { .. } => Vec::new(),
167+
Self::InvalidBinaryOperandTypes {
168+
op,
169+
lhs_expr,
170+
ref lhs_type,
171+
rhs_expr,
172+
ref rhs_type,
173+
} => Vec::new(),
168174
Self::SelectValuesTypeMismatch {
169175
accept,
170176
ref accept_ty,
@@ -182,38 +188,42 @@ impl ExpressionError {
182188
}
183189
Self::InvalidBooleanVector(handle) => just(handle),
184190
Self::InvalidFloatArgument(handle) => just(handle),
185-
Self::Type(..) => Vec::new(),
191+
Self::Type(resolve_error) => Vec::new(),
186192
Self::ExpectedGlobalVariable => Vec::new(),
187193
Self::ExpectedGlobalOrArgument => Vec::new(),
188-
Self::ExpectedBindingArrayType(..) => Vec::new(),
189-
Self::ExpectedImageType(..) => Vec::new(),
190-
Self::ExpectedSamplerType(..) => Vec::new(),
191-
Self::InvalidImageClass(..) => Vec::new(),
194+
Self::ExpectedBindingArrayType(handle) => Vec::new(),
195+
Self::ExpectedImageType(handle) => Vec::new(),
196+
Self::ExpectedSamplerType(handle) => Vec::new(),
197+
Self::InvalidImageClass(image_class) => Vec::new(),
192198
Self::InvalidDerivative => Vec::new(),
193199
Self::InvalidImageArrayIndex => Vec::new(),
194200
Self::InvalidImageOtherIndex => Vec::new(),
195201
Self::InvalidImageArrayIndexType(handle) => just(handle),
196202
Self::InvalidImageOtherIndexType(handle) => just(handle),
197203
Self::InvalidImageCoordinateType(_image_dimension, handle) => just(handle),
198-
Self::ComparisonSamplingMismatch { .. } => Vec::new(),
204+
Self::ComparisonSamplingMismatch {
205+
image,
206+
sampler,
207+
has_ref,
208+
} => Vec::new(),
199209
Self::InvalidSampleOffsetExprType => Vec::new(),
200210
Self::InvalidSampleOffset(_image_dimension, handle) => just(handle),
201211
Self::InvalidDepthReference(handle) => just(handle),
202212
Self::InvalidDepthSampleLevel => Vec::new(),
203213
Self::InvalidGatherLevel => Vec::new(),
204-
Self::InvalidGatherComponent(..) => Vec::new(),
205-
Self::InvalidGatherDimension(..) => Vec::new(),
214+
Self::InvalidGatherComponent(swizzle_component) => Vec::new(),
215+
Self::InvalidGatherDimension(image_dimension) => Vec::new(),
206216
Self::InvalidSampleLevelExactType(handle) => just(handle),
207217
Self::InvalidSampleLevelBiasType(handle) => just(handle),
208-
Self::InvalidSampleLevelBiasDimension(..) => Vec::new(),
218+
Self::InvalidSampleLevelBiasDimension(image_dimension) => Vec::new(),
209219
Self::InvalidSampleLevelGradientType(_image_dimension, handle) => just(handle),
210220
Self::InvalidCastArgument => Vec::new(),
211-
Self::WrongArgumentCount(..) => Vec::new(),
221+
Self::WrongArgumentCount(math_function) => Vec::new(),
212222
Self::InvalidArgumentType(_math_function, _, handle) => just(handle),
213-
Self::InvalidWorkGroupUniformLoadResultType(..) => Vec::new(),
214-
Self::MissingCapabilities(..) => Vec::new(),
215-
Self::Literal(..) => Vec::new(),
216-
Self::UnsupportedWidth(..) => Vec::new(),
223+
Self::InvalidWorkGroupUniformLoadResultType(handle) => Vec::new(),
224+
Self::MissingCapabilities(capabilities) => Vec::new(),
225+
Self::Literal(ref literal_error) => Vec::new(),
226+
Self::UnsupportedWidth(math_function, scalar_kind, _) => Vec::new(),
217227
}
218228
.into_iter()
219229
}

0 commit comments

Comments
 (0)