mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-31 17:31:06 +00:00
web-sys: Provide more info in logs when type conversion fails
This commit is contained in:
parent
a40f83ea1b
commit
c1f7b42662
@ -812,7 +812,12 @@ impl<'src> WebidlParse<'src, &'src str> for weedle::interface::ConstMember<'src>
|
|||||||
|
|
||||||
let ty = match idl_type.to_syn_type(TypePosition::Return) {
|
let ty = match idl_type.to_syn_type(TypePosition::Return) {
|
||||||
None => {
|
None => {
|
||||||
warn!("Can not convert const type to syn type: {:?}", idl_type);
|
warn!(
|
||||||
|
"Cannot convert const type to syn type: {:?} in {:?} on {:?}",
|
||||||
|
idl_type,
|
||||||
|
self,
|
||||||
|
self_name
|
||||||
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
},
|
},
|
||||||
Some(ty) => ty,
|
Some(ty) => ty,
|
||||||
|
@ -235,7 +235,11 @@ impl<'src> FirstPassRecord<'src> {
|
|||||||
ret @ _ => {
|
ret @ _ => {
|
||||||
match ret.to_syn_type(TypePosition::Return) {
|
match ret.to_syn_type(TypePosition::Return) {
|
||||||
None => {
|
None => {
|
||||||
warn!("Can not convert return type to syn type: {:?}", ret);
|
warn!(
|
||||||
|
"Cannot convert return type to syn type: {:?} on {:?}",
|
||||||
|
ret,
|
||||||
|
rust_name
|
||||||
|
);
|
||||||
return Vec::new();
|
return Vec::new();
|
||||||
},
|
},
|
||||||
Some(ret) => Some(ret),
|
Some(ret) => Some(ret),
|
||||||
@ -315,7 +319,11 @@ impl<'src> FirstPassRecord<'src> {
|
|||||||
let syn_type = if let Some(syn_type) = idl_type.to_syn_type(TypePosition::Argument) {
|
let syn_type = if let Some(syn_type) = idl_type.to_syn_type(TypePosition::Argument) {
|
||||||
syn_type
|
syn_type
|
||||||
} else {
|
} else {
|
||||||
warn!("Can not convert argument type to syn type: {:?}", idl_type);
|
warn!(
|
||||||
|
"Cannot convert argument type to syn type: {:?} on {:?}",
|
||||||
|
idl_type,
|
||||||
|
rust_name
|
||||||
|
);
|
||||||
continue 'outer;
|
continue 'outer;
|
||||||
};
|
};
|
||||||
let argument_name = rust_ident(&argument_name.to_snake_case());
|
let argument_name = rust_ident(&argument_name.to_snake_case());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user