You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0277]: the trait bound `Dummy: JsObject` is not satisfied
--> src/test_bindgen.rs:8:1
|
8 |#[wasm_bindgen(js_class = TestClass)]| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `JsObject` is not implemented for`Dummy`|
= help: the following other types implement trait `JsObject`:
Array
ArrayBuffer
and 71 others
= note: required for`Dummy` to implement `WasmDescribeVector`
= note: required for`Box<[Dummy]>` to implement `wasm_bindgen::describe::WasmDescribe`
= note: 1 redundant requirement hidden
= note: required for`Vec<Dummy>` to implement `wasm_bindgen::describe::WasmDescribe`
note: required by a bound in`ReturnWasmAbi`
--> /Users/bes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasm-bindgen-0.2.90/src/convert/traits.rs:177:26
|
177 | pub trait ReturnWasmAbi: WasmDescribe {
| ^^^^^^^^^^^^ required by this bound in`ReturnWasmAbi`
= note: this error originates in the attribute macro `wasm_bindgen::prelude::__wasm_bindgen_class_marker` (in Nightly builds, run with -Z macro-backtrace for more info)
But, if we wrap the Vec in something that itself implements IntoWasmAbi everything works:
Describe the Bug
It is not possible to return
Vec<T: IntoWasmAbi>
, but it is allowed to return justT
.Steps to Reproduce
Given this code
But, if we wrap the
Vec
in something that itself implementsIntoWasmAbi
everything works:Expected Behavior
I expect it to be possible to return
Vec<T>
whereT: IntoWasmAbi
.Actual Behavior
It isn't possible to return
Vec<T>
whereT: IntoWasmAbi
, but it is perfectly possible to return theVec
when a wrapper type is added.Additional Context
See also
Vec
s of and implementTryFrom<JsValue>
for strings and exported Rust types #3554tsify
has been inactive for about 9 months. There is a maintained fork here, but unfortunately no issue tracker (yet?).The text was updated successfully, but these errors were encountered: