From 6c95131720d1d390bf006f5160dcf4aa878fa4f0 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 12 Apr 2021 18:26:28 -0400 Subject: [PATCH] Ignore `Sized` bounds when processing generics --- c-bindings-gen/src/types.rs | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.39.5