Skip to content

Are raw pointers to sized types usable in C FFI ? #99

Closed
@gnzlbg

Description

@gnzlbg

AFAICT we don't mention this explicitly anywhere.

https://github.com/rust-lang/unsafe-code-guidelines/blob/master/reference/src/layout/pointers.md#representation mentions that they are one word in size, but maybe we should spell out that they are layout compatible with C pointers (including alignment) to make it clear that's ok to use raw pointers in C FFI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ffiTopic: Related to FFIA-layoutTopic: Related to data structure layout (`#[repr]`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions