mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
layouter: rich and careful errors
This commit is contained in:
@@ -824,6 +824,7 @@ impl super::Validator {
|
||||
module: &crate::Module,
|
||||
mod_info: &ModuleInfo,
|
||||
) -> Result<FunctionInfo, WithSpan<FunctionError>> {
|
||||
#[cfg_attr(not(feature = "validate"), allow(unused_mut))]
|
||||
let mut info = mod_info.process_function(fun, module, self.flags)?;
|
||||
|
||||
#[cfg(feature = "validate")]
|
||||
@@ -842,13 +843,13 @@ impl super::Validator {
|
||||
|
||||
#[cfg(feature = "validate")]
|
||||
for (index, argument) in fun.arguments.iter().enumerate() {
|
||||
let ty = module.types.get_handle(argument.ty).ok_or(
|
||||
let ty = module.types.get_handle(argument.ty).ok_or_else(|| {
|
||||
FunctionError::InvalidArgumentType {
|
||||
index,
|
||||
name: argument.name.clone().unwrap_or_default(),
|
||||
}
|
||||
.with_span_handle(argument.ty, &module.types),
|
||||
)?;
|
||||
.with_span_handle(argument.ty, &module.types)
|
||||
})?;
|
||||
match ty.inner.pointer_class() {
|
||||
Some(crate::StorageClass::Private)
|
||||
| Some(crate::StorageClass::Function)
|
||||
|
||||
Reference in New Issue
Block a user