These are chat archives for rust-lang/rust

29th
Jul 2015
debuuu
@debuuu
Jul 29 2015 07:07
How can I create an FFI function declaration with a double pointer (Blah** foo) in it, and how can I then create a pointer-to-pointer from a *const T?
This message was deleted
debuuu
@debuuu
Jul 29 2015 07:17
Ah, found it. *const *const, ha. But, I tried having a function declaration with *mut *mut, then passing a *mut T with &the_raw_mut, but it didn't work. Only works with *const T, that a limitation of double-pointers?
doesn't work in extern { ... } ?
Thomas Koehler
@Bastacyclop
Jul 29 2015 10:27
@debuuu > then passing a *mut T with &the_raw_mut
Maybe use &mut the_raw_mut ?
Peter Atashian
@retep998
Jul 29 2015 12:30
&mut implicitly coerces to *mut and & implicitly coerces to *const.
debuuu
@debuuu
Jul 29 2015 12:39
Hm. What I had was a struct with a *mut T pointer, and an unsafe function with arg: *mut *mut T
For some reason doing & on the *mut T didn't compile
Will have to look again once I'm home, but if I switched all of them to const it worked.
Peter Atashian
@retep998
Jul 29 2015 12:54
If you want to get a *mut *mut from a *mut then you need to &mut it, because a & will only give you a *const *mut
debuuu
@debuuu
Jul 29 2015 12:56
Ohhhhh now I see what you mean
Perfect, thanks! Makes sense :)
Dan Leslie
@dleslie
Jul 29 2015 17:47
What might cause the crates.io index not to have the features found within a Cargo.toml?
This is specifically related to this bug:
KevinKelley/nanovg-rs#18
Remi Rampin
@remram44
Jul 29 2015 20:42
that sounds bad
Dan Leslie
@dleslie
Jul 29 2015 21:10
heh