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
(To make this a bit less artificial, this came up in FFI code casting *mut c_void to a struct containing an unboxed FnMut closure. The fix was to box the closure to make that struct statically-sized.)
This is fine:
This does not compile, but the error message is not particularly helpful:
Invalid how? The error message should mention thin vs fat pointers or statically-sized vs dynamically-sized types, and maybe link to https://doc.rust-lang.org/book/unsized-types.html
(To make this a bit less artificial, this came up in FFI code casting
*mut c_void
to a struct containing an unboxedFnMut
closure. The fix was to box the closure to make that struct statically-sized.)CC @julienw
The text was updated successfully, but these errors were encountered: