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
As far as I can tell, if you acquire a mutable vector from C++ as Pin<&mut CxxVector<T>>, it's counterintuitively not possible to use iter_mut() with it. For example, in my bridge:
The result when I try to iterate using byml.GetArray().iter_mut():
error[E0596]: cannot borrow data in a dereference of `Pin<&mutCxxVector<ffi::Byml>>` asmutable
--> src/byml/mod.rs:55:17
|
55 | byml.GetArray()
| ^^^^^^^^^^^^^^^ cannot borrow asmutable
|
= help:trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Pin<&mutCxxVector<ffi::Byml>>````
Just to check,I also found it happens with more trivial cases like `Pin<&mutCxxVector<u8>>`.
The text was updated successfully, but these errors were encountered:
NiceneNerd
changed the title
Cannot use iter_mut on mutable CxxVector?
Cannot use iter_mut() on mutable CxxVector?
Dec 31, 2020
As far as I can tell, if you acquire a mutable vector from C++ as
Pin<&mut CxxVector<T>>
, it's counterintuitively not possible to useiter_mut()
with it. For example, in my bridge:The result when I try to iterate using
byml.GetArray().iter_mut()
:The text was updated successfully, but these errors were encountered: