|
39 | let fns: &mut [unsafe extern "stdcall" fn(u32)] = [mem::zeroed(); 1000 ];
| ^^^^^^^^^^^^^^^^^^^^^^ expected mutable reference, found array of 1000 elements
|
= note: expected type `&mut [unsafe extern "stdcall" fn(u32)]`
found type `[_; 1000]`
&mut
in front of the array initializer.
com_func((&mut fns.as_mut_ptr()) as *mut _ as *mut _)
syntax. I'm unsure what's going on here.
fns
is (a mutable reference to) an array of function pointers; the as_mut_ptr
call transforms it into a mutable raw pointer to the first element (that is, a C-like representation of the array).
RIDL!
from winapi which is much more ergonomic)
&mut *mut F
into a *mut *mut F
, the second turns a *mut *mut F
into a *mut *mut libc::c_ulong
, where F
is the type of the function pointers.
_
.
client::new(URL).repository("foo").content("/bar")
. I am using serde for the reprentations of the Repository
and Content
objects returned by the service, which works fine, but those objects have no knowledge of the client. I have made a struct like struct Item<T> { client: &Client, Item: T }
and then use that for all operations requiring further calls, but it just seems clunky
extern
blocks and impl Trait
?
impl Trait
usage had nothing to do with it, and that there was an unfulfilled extern dependency that was merely masked by the presence of the existential.
impl Trait
the problem goes away.
impl Trait
is still unstable. XD
impl Trait
bugs ;)
rustup update
:tada: