rust-lang / rust-lang/rust

Lint against using `libc::c_*` types in std if they're also avaliable in `core::ffi`

Open
#126,598 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-lints C-enhancement T-compiler T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

We should prefer to consistently use core::ffi::{c_char, c_void, ...} over their libc equivalents because core::ffi should be the source of truth for std and libc may not always be used on all targets (e.g. windows or linux-unknown-unknown).

So it would be good to lint on this if it's possible.

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

The issue names no files, tests, or entry points. Start by locating the compiler lint infrastructure and the std uses of libc::c_* types, then determine how availability in core::ffi is represented across targets. Done means the lint consistently flags eligible libc types while accounting for targets where libc is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.