From: Matt Corallo Date: Sun, 31 Oct 2021 23:32:55 +0000 (+0000) Subject: Check if types are understood before we map an impl block for them X-Git-Tag: v0.0.103.0^2~9 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=commitdiff_plain;h=3a9500828833fa20d8d8c44eea4ed05342187fa9 Check if types are understood before we map an impl block for them --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index ea624e5..b88f37f 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -771,6 +771,11 @@ fn writeln_impl(w: &mut W, i: &syn::ItemImpl, types: &mut Typ if p.qself.is_some() { unimplemented!(); } if let Some(ident) = single_ident_generic_path_to_ident(&p.path) { if let Some(resolved_path) = types.maybe_resolve_non_ignored_ident(&ident) { + if !types.understood_c_path(&p.path) { + eprintln!("Not implementing anything for impl {} as the type is not understood (probably C-not exported)", ident); + return; + } + let mut gen_types = GenericTypes::new(Some(resolved_path.clone())); if !gen_types.learn_generics(&i.generics, types) { eprintln!("Not implementing anything for impl {} due to not understood generics", ident);