Skip to content

Functions using c_char show misleading "i8" instead of docs #113735

Open
@glandium

Description

@glandium

Take for example https://doc.rust-lang.org/std/ffi/struct.CStr.html#method.from_ptr, which says the signature for CStr::from_ptr is:

pub unsafe fn from_ptr<'a>(ptr: *const i8) -> &'a CStr

The real signature uses c_char instead of i8, which is notably different because c_char can be either i8 or u8 depending on the platform. I had to follow the link to the source to make sure it was taking *const c_char and not an actual *const i8, which would have required a conversion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions