From: Matt Corallo Date: Sat, 24 Dec 2022 05:01:25 +0000 (+0000) Subject: Allow enums with lifetime-only generics X-Git-Tag: v0.0.113.0^2~9 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=09bc0bfd1e60b8a57040868f0b440b4f0f41a65b;p=ldk-c-bindings Allow enums with lifetime-only generics --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 0e9a422..903ebfc 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -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();