Skip to content

Tracking Issue for std::ffi::c_str module #112134

Open

Description

Feature gate: #![feature(c_str_module)]

This is a tracking issue for the std::ffi::c_str module.

Public API

This adds {core, alloc, std}::ffi::c_str modules and migrates some existing types into them. Types will still be re-exported in their current places to ensure compatibility.

The following migrations are made:

  • core::ffi::CStr => core::ffi::c_str::CStr
  • core::ffi::FromBytesUntilNulError => core::ffi::c_str::FromBytesUntilNulError
  • core::ffi::FromBytesWithNulError => core::ffi::c_str::FromBytesWithNulError
  • alloc::ffi::CString => alloc::ffi::c_str::CString
  • alloc::ffi::FromVecWIthNulError => alloc::ffi::c_str::FromVecWIthNulError
  • alloc::ffi::IntoStringError => alloc::ffi::c_str::IntoStringError
  • alloc::ffi::NulError => alloc::ffi::c_str::NulError

And these types are also migrated on the std crate as well.

Steps / History

Unresolved Questions

  • Should c_str and c_string be separated? This was not discussed in the original ACP.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/api-change-proposals.html

  2. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.T-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