From: Matt Corallo Date: Mon, 12 Apr 2021 22:26:28 +0000 (-0400) Subject: Ignore `Sized` bounds when processing generics X-Git-Tag: v0.0.98~14^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=6c95131720d1d390bf006f5160dcf4aa878fa4f0;p=ldk-c-bindings Ignore `Sized` bounds when processing generics --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index edd993f..2cb9369 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -194,6 +194,7 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { assert_simple_bound(&trait_bound); if let Some(mut path) = types.maybe_resolve_path(&trait_bound.path, None) { if types.skip_path(&path) { continue; } + if path == "Sized" { continue; } if non_lifetimes_processed { return false; } non_lifetimes_processed = true; let new_ident = if path != "std::ops::Deref" { @@ -223,6 +224,9 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { let mut non_lifetimes_processed = false; for bound in t.bounds.iter() { if let syn::TypeParamBound::Trait(trait_bound) = bound { + if let Some(id) = trait_bound.path.get_ident() { + if format!("{}", id) == "Sized" { continue; } + } if non_lifetimes_processed { return false; } non_lifetimes_processed = true; assert_simple_bound(&trait_bound);