mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-01 18:01:06 +00:00
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:
parent
b3cb44eb53
commit
cfe7ebd463
@ -704,6 +704,10 @@ impl ImportType {
|
|||||||
|
|
||||||
impl Struct {
|
impl Struct {
|
||||||
fn from(s: &mut syn::ItemStruct, _opts: BindgenAttrs) -> 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();
|
let mut fields = Vec::new();
|
||||||
if let syn::Fields::Named(names) = &mut s.fields {
|
if let syn::Fields::Named(names) = &mut s.fields {
|
||||||
for field in names.named.iter_mut() {
|
for field in names.named.iter_mut() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user