Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std library thread.rs: fix NetBSD code for ILP32 CPUs. #123038

Merged
merged 1 commit into from Mar 27, 2024

Conversation

he32
Copy link
Contributor

@he32 he32 commented Mar 25, 2024

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2024

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 25, 2024
@workingjubilee
Copy link
Contributor

Trading with Chris for some Unix API reviews now for Windows API reviews later. :^)

r? @workingjubilee

Comment on lines 427 to 428
for i in 0..u32::MAX {
match libc::_cpuset_isset(i.into(), set) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument is an unsigned long, so why is this not c_ulong::MAX, exactly?

Copy link
Contributor Author

@he32 he32 Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, because I know too little rust. :) And perhaps because I follow too closely in the footsteps already trodden, not wanting to deviate too far.
It's not as if the loop won't terminate long before any of those values are reached, so in practical terms the only difference would be the ability to get rid of the .into().
Or ... ideally one should be able to use cpuid_t::MAX, or (a compilation attempt later) libc::cpuid_t::MAX?
I've added a commit which makes that change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, realistically it will never matter!

yeah, I mostly just want the alias to be "self-documenting". in this case it works because the alias means the type so the alias does indeed resolve to a type with an associated constant.

@workingjubilee
Copy link
Contributor

Thanks!

@he32 Can you squash the commits since they're really the same change?

r=me with that

@bors delegate+

@bors
Copy link
Contributor

bors commented Mar 25, 2024

✌️ @he32, you can now approve this pull request!

If @workingjubilee told you to "r=me" after making some further change, please make that change, then do @bors r=@workingjubilee

@he32
Copy link
Contributor Author

he32 commented Mar 26, 2024

@bors r=@workingjubilee
(I was told to do...)

@bors
Copy link
Contributor

bors commented Mar 26, 2024

📌 Commit 1ad3954 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 26, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 26, 2024
…bilee

std library thread.rs: fix NetBSD code for ILP32 CPUs.
@workingjubilee
Copy link
Contributor

@bors rollup=always

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 27, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#122439 (match lowering: build the `Place` instead of keeping a `PlaceBuilder` around)
 - rust-lang#122880 (Unix: Support more platforms with `preadv` and `pwritev`)
 - rust-lang#123038 (std library thread.rs: fix NetBSD code for ILP32 CPUs.)
 - rust-lang#123084 (`UnixStream`: override `read_buf`)
 - rust-lang#123102 (RustWrapper: update call for llvm/llvm-project@44d037cc258dcf179d2c48…)
 - rust-lang#123107 (Implement `Vec::pop_if`)
 - rust-lang#123118 (Update `RwLock` deadlock example to not use shadowing)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d589021 into rust-lang:master Mar 27, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 27, 2024
Rollup merge of rust-lang#123038 - he32:netbsd-ilp32-fix, r=workingjubilee

std library thread.rs: fix NetBSD code for ILP32 CPUs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants