Skip to content

Tracking Issue for core_ffi_c #94501

Closed
Closed
@joshtriplett

Description

@joshtriplett

Feature gate: #![feature(core_ffi_c)]

This is a tracking issue for providing the aliases for C types (c_int, c_char, etc) via core::ffi, not just via std::os::raw. The ability to interoperate with C code via FFI is not limited to crates using std; this allows using these types without std.

Public API

// core::ffi

pub type c_char = ...;
pub type c_short = ...;
pub type c_ushort = ...;
pub type c_int = ...;
pub type c_uint = ...;
// ...

The existing types in std::os::raw will become type aliases for the ones in core::ffi. This will use type aliases rather than re-exports, to allow the std types to remain stable while the core types are unstable.

This also moves the currently unstable NonZero variants and c_size_t/c_ssize_t/c_ptrdiff_t types to core::ffi, while leaving them unstable.

Steps / History

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions