diff --git a/src/macros/generate/convert/auxiliary/c/type/mod.rs b/src/macros/generate/convert/auxiliary/c/type/mod.rs index 302b9e7..ecae9e3 100644 --- a/src/macros/generate/convert/auxiliary/c/type/mod.rs +++ b/src/macros/generate/convert/auxiliary/c/type/mod.rs @@ -68,7 +68,9 @@ impl Type { .map(|r#type| r#type.to_auxiliary_c(false, field_name)) .collect(); - let field_name = field_name.expect("This is some, when I'm a function type").to_rust(); + let field_name = field_name + .expect("This is some, when it's a function type") + .to_rust(); quote! { #output (*#field_name) (#(#inputs),*) diff --git a/src/macros/generate/host/mod.rs b/src/macros/generate/host/mod.rs index f514ee1..e416272 100644 --- a/src/macros/generate/host/mod.rs +++ b/src/macros/generate/host/mod.rs @@ -34,7 +34,9 @@ pub mod rust; pub fn format_rust(input: TokenStream2) -> String { prettyplease::unparse( - &syn::parse2(input).expect("This code was generated, it should also be parsable"), + &syn::parse2(input.clone()).map_err(|err| { + eprintln!("{}:\n===\n{}\n===\n", err, input); + }).expect("This code was generated, it should also be parsable"), ) }