projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d9866e8
)
Ignore `Sized` bounds when processing generics
author
Matt Corallo
<git@bluematt.me>
Mon, 12 Apr 2021 22:26:28 +0000
(18:26 -0400)
committer
Matt Corallo
<git@bluematt.me>
Thu, 15 Apr 2021 22:01:27 +0000
(18:01 -0400)
c-bindings-gen/src/types.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/types.rs
b/c-bindings-gen/src/types.rs
index edd993f9be137fa45d752dc51d01ba6538fc30eb..2cb93690095247845687370e2011220b3dda945f 100644
(file)
--- 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; }
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" {
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 {
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);
if non_lifetimes_processed { return false; }
non_lifetimes_processed = true;
assert_simple_bound(&trait_bound);