X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Fmain.rs;h=280f94e9de408af0e367d67234cec85f672a939b;hp=4d5b07021c7cd110aafe6917fa77a2f5dd70880a;hb=e63c8846af0e37b6573dd3dde03a2954e1ca3eee;hpb=fc3bfd9a0b3cf846bd9c3187bb1b0363611f0708 diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 4d5b070..280f94e 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -491,13 +491,18 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty &syn::TraitItem::Type(ref t) => { if t.default.is_some() || t.generics.lt_token.is_some() { unimplemented!(); } let mut bounds_iter = t.bounds.iter(); - match bounds_iter.next().unwrap() { - syn::TypeParamBound::Trait(tr) => { - writeln!(w, "\ttype {} = crate::{};", t.ident, $type_resolver.resolve_path(&tr.path, Some(&gen_types))).unwrap(); - }, - _ => unimplemented!(), + loop { + match bounds_iter.next().unwrap() { + syn::TypeParamBound::Trait(tr) => { + writeln!(w, "\ttype {} = crate::{};", t.ident, $type_resolver.resolve_path(&tr.path, Some(&gen_types))).unwrap(); + for bound in bounds_iter { + if let syn::TypeParamBound::Trait(_) = bound { unimplemented!(); } + } + break; + }, + syn::TypeParamBound::Lifetime(_) => {}, + } } - if bounds_iter.next().is_some() { unimplemented!(); } }, _ => unimplemented!(), }