writeln!(extra_headers, "struct LDK{};", trait_name).unwrap();
continue;
}
- // Sadly, this currently doesn't do what we want, but it should be easy to get
- // cbindgen to support it. See https://github.com/eqrion/cbindgen/issues/531
- writeln!(w, "\t#[must_use]").unwrap();
}
let mut cpp_docs = Vec::new();
syn::TypeParamBound::Trait(tr) => {
writeln!(w, "\ttype {} = crate::{};", t.ident, $type_resolver.resolve_path(&tr.path, Some(&gen_types))).unwrap();
for bound in bounds_iter {
- if let syn::TypeParamBound::Trait(_) = bound { panic!("11"); }
+ 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;
},