projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
077c4d7
)
Allow enums with lifetime-only generics
author
Matt Corallo
<git@bluematt.me>
Sat, 24 Dec 2022 05:01:25 +0000
(
05:01
+0000)
committer
Matt Corallo
<git@bluematt.me>
Sat, 24 Dec 2022 22:59:55 +0000
(22:59 +0000)
c-bindings-gen/src/main.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/main.rs
b/c-bindings-gen/src/main.rs
index 0e9a42286a1434ef6a8e3ea4f8c60356277c658e..903ebfc5089f05217e13412af677cb4999ef7e14 100644
(file)
--- a/
c-bindings-gen/src/main.rs
+++ b/
c-bindings-gen/src/main.rs
@@
-849,7
+849,8
@@
fn writeln_struct<'a, 'b, W: std::io::Write>(w: &mut W, s: &'a syn::ItemStruct,
write!(w, "\t}}").unwrap();
},
syn::Fields::Unnamed(fields) => {
write!(w, "\t}}").unwrap();
},
syn::Fields::Unnamed(fields) => {
- assert!(s.generics.lt_token.is_none());
+ assert!(!s.generics.params.iter()
+ .any(|gen| if let syn::GenericParam::Lifetime(_) = gen { false } else { true }));
writeln!(w, "{} (", types.maybe_resolve_ident(&s.ident).unwrap()).unwrap();
for (idx, field) in fields.unnamed.iter().enumerate() {
write!(w, "\t\t").unwrap();
writeln!(w, "{} (", types.maybe_resolve_ident(&s.ident).unwrap()).unwrap();
for (idx, field) in fields.unnamed.iter().enumerate() {
write!(w, "\t\t").unwrap();