Disallow structs w/ lifetime/type parameters

These can't work currently with wasm-bindgen, but maybe one day!

Closes #200
This commit is contained in:
Alex Crichton 2018-05-21 09:13:17 -07:00
parent b3cb44eb53
commit cfe7ebd463

View File

@ -704,6 +704,10 @@ impl ImportType {
impl Struct {
fn from(s: &mut syn::ItemStruct, _opts: BindgenAttrs) -> Struct {
if s.generics.params.len() > 0 {
panic!("structs with #[wasm_bindgen] cannot have lifetime or \
type parameters currently");
}
let mut fields = Vec::new();
if let syn::Fields::Named(names) = &mut s.fields {
for field in names.named.iter_mut() {