Skip to content

cygwin: fix cpuset_t typo in CPU_ZERO#5098

Merged
JohnTitor merged 1 commit into
rust-lang:mainfrom
phdye-cygwin-rust:cygwin-cpuset_t-typo
May 7, 2026
Merged

cygwin: fix cpuset_t typo in CPU_ZERO#5098
JohnTitor merged 1 commit into
rust-lang:mainfrom
phdye-cygwin-rust:cygwin-cpuset_t-typo

Conversation

@phdye
Copy link
Copy Markdown
Contributor

@phdye phdye commented May 7, 2026

Description

CPU_ZERO in src/unix/cygwin/mod.rs:1712 declares its parameter as &mut cpuset_t, but no type by that name exists in the cygwin module. The struct is cpu_set_t (defined at line 91), and every sibling function (CPU_SET, CPU_CLR, CPU_ISSET, CPU_COUNT, CPU_COUNT_S, CPU_EQUAL) correctly uses cpu_set_t.

The typo prevents the cygwin module from compiling on x86_64-pc-cygwin:

error[E0425]: cannot find type `cpuset_t` in this scope
    --> src/unix/cygwin/mod.rs:1712:34
     |
1712 |     pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
     |                                  ^^^^^^^^

Sources

Internal — typo in this crate. The cpu_set_t struct is the only definition; no upstream header reference needed.

Checklist

  • Relevant tests in libc-test/semver have been updated — N/A; not adding/removing symbols.
  • No placeholder or unstable values like *LAST or *MAX are included
  • Tested locally — with this fix applied on main, cargo test --target x86_64-pc-cygwin builds and passes the full suite (2968 ctest cases, all other suites green).

@rustbot label +stable-nominated

CPU_ZERO at src/unix/cygwin/mod.rs:1712 declares its parameter as
&mut cpuset_t, but no type by that name exists in the cygwin
module. The struct is cpu_set_t (defined at line 91), and every
sibling function (CPU_SET, CPU_CLR, CPU_ISSET, CPU_COUNT,
CPU_COUNT_S, CPU_EQUAL) correctly uses cpu_set_t. The typo
prevents the cygwin module from compiling on x86_64-pc-cygwin:

  error[E0425]: cannot find type `cpuset_t` in this scope
      --> src/unix/cygwin/mod.rs:1712:34
       |
  1712 |     pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
       |                                  ^^^^^^^^

After this fix, libc and libc-test build cleanly for
x86_64-pc-cygwin and the full libc-test suite passes (2968 ctest
cases, all other targets green).
@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels May 7, 2026
@phdye
Copy link
Copy Markdown
Contributor Author

phdye commented May 7, 2026

Companion PR for the same Cygwin port: #5099 (off-by-one in utsname.sysname length). The two are independent but libc-test on x86_64-pc-cygwin only runs end-to-end with both fixes applied — this PR is the prerequisite that lets the cygwin module compile, and #5099 then passes the suite.

@JohnTitor JohnTitor added this pull request to the merge queue May 7, 2026
Merged via the queue into rust-lang:main with commit 41f2d1d May 7, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants