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.
Currently we automatically coerce from
&Footo*Foo, which makes interop much nicer. However, for C APIs that have some calls taking*mut Fooand some*Foo(getters and setters on an opaque structure for example), you must currently do a lot of&*footo turn*mut Foointo*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 Foomight just go away, but if it's here to stay, then more coersion would be nice.