Skip to content

Clarify story on *T (unsafe pointers) #7362

Closed
@metajack

Description

@metajack

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions