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[E0507]: cannot move out of `*resource_a0` which is behind a shared reference
--> src/lib.rs:1:1
|
1 | / wit_bindgen::generate!({
2 || world: "test-world",
3 || });|| ^
|||||__`*resource_a0` moved due to this method call
| move occurs because `*resource_a0` has type`ResourceA`, which does not implement the `Copy` trait
|
note: `ResourceA::into_handle` takes ownership of the receiver `self`, which moves `*resource_a0`
--> src/lib.rs:1:1
|
1 | / wit_bindgen::generate!({
2 || world: "test-world",
3 || });||__^
= note: this error originates in the macro `wit_bindgen::generate` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0507`.
error: could not compile `wasm-component-test` (lib) due to previous error
The combination that cause the error is a field of a resource and a another field with a list of the same type resource. If I remove one of the field, it compiles with no error.
The text was updated successfully, but these errors were encountered:
alexcrichton
added a commit
to alexcrichton/witx-bindgen
that referenced
this issue
Sep 14, 2023
I went ahead and did a bit more refactoring at the logic here since I
think the old conditions aren't as applicable any more (they haven't
aged well)
Closesbytecodealliance#668
* Fix taking owned resource handles in Rust imports
I went ahead and did a bit more refactoring at the logic here since I
think the old conditions aren't as applicable any more (they haven't
aged well)
Closes#668
* Fix test compilation
* Ignore some more resources tests
An example for a wit file that cause the error:
With this rust code:
I get the following error:
The combination that cause the error is a field of a resource and a another field with a list of the same type resource. If I remove one of the field, it compiles with no error.
The text was updated successfully, but these errors were encountered: