Closed
Description
Currently we automatically coerce from &Foo
to *Foo
, which makes interop much nicer. However, for C APIs that have some calls taking *mut Foo
and some *Foo
(getters and setters on an opaque structure for example), you must currently do a lot of &*foo
to turn *mut Foo
into *Foo
. It would be much more convenient to coerce to immutable automatically.
I feel like the current situation punishes correct type annotation of FFI calls.
@nikomatsakis mentioned in IRC that *mut Foo
might just go away, but if it's here to stay, then more coersion would be nice.