X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=e45fdca095ddb5552cb72f95d81bc631af2b0ff1;hb=4f282d4cdae9b2e79e4fd604b629517898f02262;hp=608a34aa8834ecb47a8597891916f4358de08c4d;hpb=05cfd2ecf17b58093f031b569deab7b199c06088;p=ldk-c-bindings diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 608a34a..e45fdca 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -215,7 +215,7 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { 'bound_loop: for bound in type_param.bounds.iter() { if let syn::TypeParamBound::Trait(trait_bound) = bound { if let Some(ident) = single_ident_generic_path_to_ident(&trait_bound.path) { - match &format!("{}", ident) as &str { "Send" => continue, "Sync" => continue, _ => {} } + match &format!("{}", ident) as &str { "Send" => continue, "Sync" => continue, "Sized" => continue, _ => {} } } if path_matches_nongeneric(&trait_bound.path, &["core", "clone", "Clone"]) { continue; } @@ -352,7 +352,12 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { } } else { unimplemented!(); } for bound in bounds_iter { - if let syn::TypeParamBound::Trait(_) = bound { unimplemented!(); } + if let syn::TypeParamBound::Trait(t) = bound { + // We only allow for `?Sized` here. + if let syn::TraitBoundModifier::Maybe(_) = t.modifier {} else { panic!(); } + assert_eq!(t.path.segments.len(), 1); + assert_eq!(format!("{}", t.path.segments[0].ident), "Sized"); + } } break; },