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
1 error[E0509]: cannot move out of type `CheeseVec`, which implements the `Drop` trait
--> src/main.rs:18:31
|
18 | let CheeseVec { smell } = cheeses;
| ----- ^^^^^^^ cannot move out of here
| |
| data moved here
| move occurs because `smell` has type `Vec<f64>`, which does not implement the `Copy` trait
|
help: consider borrowing the pattern binding
|
18 | let CheeseVec { ref smell } = cheeses;
| +++
For more information about this error, try `rustc --explain E0509`.
Is there any way to take ownership of the fields of a CheeseVec? Is this a feature that soa_derive could implement? Is there any workaround for the above error?
The text was updated successfully, but these errors were encountered:
This looks like a fallout from allowing Drop types in a SoA: #38, which added a Drop implementation to Vec.
I'd guess the best solution would be to only add Drop to a SoA Vec if the type itself implements Drop. I don't have a lot of time to work on this crate these days, so your best solution might be to revert to an older version until this is fixed.
I wish to move out of the
CheeseVec
, which seems impossible becauseCheeseVec
implementsDrop
:Is there any way to take ownership of the fields of a
CheeseVec
? Is this a feature thatsoa_derive
could implement? Is there any workaround for the above error?The text was updated successfully, but these errors were encountered: