rust-lang / rust-lang/libc

Remove the `libc` version of `core::ffi` primitives

Open
#4,257 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-cleanup
Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
69

Description

Now that these exist in core, there isn't any reason to duplicate the definitions here. For 1.0 we should remove the types from libc in favor of using core::ffi.

Ideally we would also make a change in 0.2 to reexport the types rather than redefining them. We can't do this yet because our MSRV is 1.63 and core::ffi::c_char is not available until 1.64. However even once the MSRV upgrade happens, we need to be a bit careful; Rust 1.85 (https://github.com/rust-lang/rust/pull/132975) and libc 0.2.169 corrected the signedness of c_char on a number of platforms which was accepted minor breakage. If we switch to reexporting then we break things a second time for new libc with older Rust.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the duplicated libc definitions corresponding to core::ffi primitives and review the Rust MSRV and libc version constraints described in the issue. Done means the 1.0 types are removed and the 0.2 re-export approach is resolved without introducing an additional signedness break.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.