Raise MSRV to 1.64 and delegate `ctypes` type aliases to `core::ffi`

Open Beginner friendly
#188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

Start with the rust-version setting in Cargo.toml and the ctypes type-alias module in src/lib.rs. Check the Rust 1.64 core::ffi types and existing target conditionals, then run the existing test suite. Done means the MSRV is 1.64, aliases delegate to core::ffi, and supported targets retain their current behavior.

Written by the indexing model from the issue text.

Description

Just sharing this observation despite the benefit likely being minimal. Delegating the C FFI type aliases to those from core::ffi by bumping rust-version to 1.64 seems desirable?

It'd have avoided the need for PRs like this in March 2026 for example (which is merged but still unreleased).


Details

Presently linux-raw-sys supports Rust 1.63 (Aug 2022) as a minimum (in May 2023 rust-version was bumped from 1.48 to benefit from improved const fn support):

https://github.com/sunfishcode/linux-raw-sys/blob/3b15c17f2688445cd3e9ef2907113829837773dd/Cargo.toml#L13

In Nov 2021 linux-raw-sys switched from a cty crate dep to vendoring it's own ctypes type alias module, which presently has required a bit of maintenance support over the past year for Tier 3 targets with ensuring the correct c_char (m68k, hexagon (as a follow-up to restoring support), MIPS R6).

Since Rust 1.64 (Sep 2022) the equivalent FFI C types have been available via the core crate (the target list is managed by a cfg_select! macro, and prior to that the cfg_if! crate macro).

Although this comment says core was not available for a m68k target? (unless they used rustc_codegen_gcc) but as core is already used elsewhere in this crate I assume that wouldn't equate to a regression 😅

Dominant language
Rust
Stars
71
Forks
63
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from sunfishcode/linux-raw-sys

All issues in sunfishcode/linux-raw-sys

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.