rune icon indicating copy to clipboard operation
rune copied to clipboard

`VecDeque` can't be sent through Rune

Open HoloTheDrunk opened this issue 10 months ago • 3 comments

Attempt

#[derive(Any)]
struct MyStruct {
    #[rune(get)]
    dvec: VecDeque<i64>,
}

Expected behaviour The code compiles without issue.

Actual behaviour The compiler throws this error:

error[E0277]: the trait bound `{closure@src/main.rs:8:10: 8:13}: InstanceFunction<_, Plain>` is not satisfied
    --> src/main.rs:8:10
     |
8    |   #[derive(Any)]
     |            ^^^ the trait `InstanceFunction<_, Plain>` is not implemented for closure `{closure@src/main.rs:8:10: 8:13}`
9    |   struct MyStruct {
10   | /     #[rune(get)]
11   | |     dvec: VecDeque<i64>,
     | |_______________________- required by a bound introduced by this call
     |
note: required by a bound in `rune::Module::field_function`
    --> /home/RDuhen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rune-0.13.2/src/module/module.rs:1603:12
     |
1595 |     pub fn field_function<N, F, A>(
     |            -------------- required by a bound in this associated function
...
1603 |         F: InstanceFunction<A, Plain>,
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Module::field_function`

Note Another error message I have not been able to reproduce said something along the lines of "VecDeque is missing a Rune clone implementation", which could be what's preventing passing VecDeques to a Rune VM.

HoloTheDrunk avatar Apr 23 '24 14:04 HoloTheDrunk