Ignore async functions as mapping them would be substantial work
[ldk-c-bindings] / c-bindings-gen / src / main.rs
index 0e9a42286a1434ef6a8e3ea4f8c60356277c658e..f5a7656c0af60aecba2729388b9d503087d89ae8 100644 (file)
@@ -849,7 +849,8 @@ fn writeln_struct<'a, 'b, W: std::io::Write>(w: &mut W, s: &'a syn::ItemStruct,
                                write!(w, "\t}}").unwrap();
                        },
                        syn::Fields::Unnamed(fields) => {
-                               assert!(s.generics.lt_token.is_none());
+                               assert!(!s.generics.params.iter()
+                                       .any(|gen| if let syn::GenericParam::Lifetime(_) = gen { false } else { true }));
                                writeln!(w, "{} (", types.maybe_resolve_ident(&s.ident).unwrap()).unwrap();
                                for (idx, field) in fields.unnamed.iter().enumerate() {
                                        write!(w, "\t\t").unwrap();
@@ -1359,6 +1360,7 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, w_uses: &mut HashSet<String, NonRa
                                                                                ExportStatus::NoExport|ExportStatus::TestOnly => continue,
                                                                                ExportStatus::NotImplementable => panic!("(C-not implementable) must only appear on traits"),
                                                                        }
+                                                                       if m.sig.asyncness.is_some() { continue; }
                                                                        let mut meth_gen_types = gen_types.push_ctx();
                                                                        assert!(meth_gen_types.learn_generics(&m.sig.generics, types));
                                                                        if m.defaultness.is_some() { unimplemented!(); }