crate: clean up leftovers from pre-rustc 1.19 without unions - #5351
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
| #[cfg_attr(any(target_arch = "x86", target_arch = "x86_64"), repr(packed(4)))] | ||
| pub struct epoll_event { | ||
| pub events: u32, | ||
| pub data: epoll_data, | ||
| } | ||
|
|
||
| pub union epoll_data { | ||
| pub ptr: *mut c_void, | ||
| pub fd: c_int, | ||
| pub u32: u32, | ||
| pub u64: u64, | ||
| } |
|
Reminder, once the PR becomes ready for a review, use |
078195b to
50d04e5
Compare
This comment has been minimized.
This comment has been minimized.
50d04e5 to
0978aac
Compare
There was a problem hiding this comment.
LGTM, thanks!
I actually don't think we should have the epoll_event changes in 0.2 since we opted out of backporting the fix on Linux (1d10a3f). I'll exclude the relevant commits when picking.
Remove a check in the Linux routine of build the build script that skipped a field whose type was a `union` upstream but only a specific field of the `union` in Rust. This is a remnant of versions prior to Rust 1.19, where `union`s got introduced. The definition under `unix/linux_like/mod.rs` uses a `union` for that field. The check is redundant now.
Replace field of `epoll_event` that was once only a single field of the upstream `union` with a proper `union`. This was done back before Rust had received support for `union`s, so it's redundant to keep this binding now. The build script also had a skip set in place for this one field, and that now has also been removed.
Remove check in Linux test routine for a field of `sigevent` that was once (pre-Rust 1.19) implemented as a `struct` instead of a `union`. This is no more the case so the check in the build script is redundant.
Remove check for `cpuid_info` as a `union` as that dates back to the times where Rust didn't itself have `union`s so this type had to be implemented as a `struct`. Skipping it in libc-test's build script is redundant. The same applies to `cpu_topology_node_info`.
Replace dummy field for `union` with an actual definition fitting that of the upstream type. The current (pre-patch) field corresponded with the times back when Rust didn't have `union`s. Now it's not necessary anymore to expose only a single field of the `union`. The corresponding skip in libc-test's build script has also been removed.
Remove a skip over `sigaction` in Hexagon QuRT as it seems the separate fields in Rust mentioned in libc-test's build script's skip aligns well with the (also) split fields upstream. See header file `posix/signal.h` under `rtos/qurt/computev81` in the Hexagon SDK.
Remove skip over `sem_t` in Hexagon QuRT as it alleged to this being a `typedef` of an anonymous `struct`, but that also happens in other targets we test against without there being skips for their records. See header file `posix/semaphore.h` under `rtos/qurt/computev81` in the Hexagon SDK for details.
0978aac to
de46d22
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Remove check for `cpuid_info` as a `union` as that dates back to the times where Rust didn't itself have `union`s so this type had to be implemented as a `struct`. Skipping it in libc-test's build script is redundant. The same applies to `cpu_topology_node_info`. (backport <rust-lang#5351>) (cherry picked from commit 12fe28d)
Replace dummy field for `union` with an actual definition fitting that of the upstream type. The current (pre-patch) field corresponded with the times back when Rust didn't have `union`s. Now it's not necessary anymore to expose only a single field of the `union`. The corresponding skip in libc-test's build script has also been removed. (backport <rust-lang#5351>) (cherry picked from commit 97ad377)
Remove a skip over `sigaction` in Hexagon QuRT as it seems the separate fields in Rust mentioned in libc-test's build script's skip aligns well with the (also) split fields upstream. See header file `posix/signal.h` under `rtos/qurt/computev81` in the Hexagon SDK. (backport <rust-lang#5351>) (cherry picked from commit 96baf11)
Remove skip over `sem_t` in Hexagon QuRT as it alleged to this being a `typedef` of an anonymous `struct`, but that also happens in other targets we test against without there being skips for their records. See header file `posix/semaphore.h` under `rtos/qurt/computev81` in the Hexagon SDK for details. (backport <rust-lang#5351>) (cherry picked from commit 471be3d)
Replace field of `epoll_event` that was once only a single field of the upstream `union` with a proper `union`. This was done back before Rust had received support for `union`s, so it's redundant to keep this binding now. The build script also had a skip set in place for this one field, and that now has also been removed. (backport <rust-lang#5351>) (cherry picked from commit 3b624ac)
Remove check for `cpuid_info` as a `union` as that dates back to the times where Rust didn't itself have `union`s so this type had to be implemented as a `struct`. Skipping it in libc-test's build script is redundant. The same applies to `cpu_topology_node_info`. (backport <rust-lang#5351>) (cherry picked from commit 12fe28d)
Replace dummy field for `union` with an actual definition fitting that of the upstream type. The current (pre-patch) field corresponded with the times back when Rust didn't have `union`s. Now it's not necessary anymore to expose only a single field of the `union`. The corresponding skip in libc-test's build script has also been removed. (backport <rust-lang#5351>) (cherry picked from commit 97ad377)
Remove a skip over `sigaction` in Hexagon QuRT as it seems the separate fields in Rust mentioned in libc-test's build script's skip aligns well with the (also) split fields upstream. See header file `posix/signal.h` under `rtos/qurt/computev81` in the Hexagon SDK. (backport <rust-lang#5351>) (cherry picked from commit 96baf11)
Remove skip over `sem_t` in Hexagon QuRT as it alleged to this being a `typedef` of an anonymous `struct`, but that also happens in other targets we test against without there being skips for their records. See header file `posix/semaphore.h` under `rtos/qurt/computev81` in the Hexagon SDK for details. (backport <rust-lang#5351>) (cherry picked from commit 471be3d)
Remove check for `cpuid_info` as a `union` as that dates back to the times where Rust didn't itself have `union`s so this type had to be implemented as a `struct`. Skipping it in libc-test's build script is redundant. The same applies to `cpu_topology_node_info`. (backport <rust-lang#5351>) (cherry picked from commit 12fe28d)
Replace dummy field for `union` with an actual definition fitting that of the upstream type. The current (pre-patch) field corresponded with the times back when Rust didn't have `union`s. Now it's not necessary anymore to expose only a single field of the `union`. The corresponding skip in libc-test's build script has also been removed. (backport <rust-lang#5351>) (cherry picked from commit 97ad377)
Remove a skip over `sigaction` in Hexagon QuRT as it seems the separate fields in Rust mentioned in libc-test's build script's skip aligns well with the (also) split fields upstream. See header file `posix/signal.h` under `rtos/qurt/computev81` in the Hexagon SDK. (backport <rust-lang#5351>) (cherry picked from commit 96baf11)
Remove skip over `sem_t` in Hexagon QuRT as it alleged to this being a `typedef` of an anonymous `struct`, but that also happens in other targets we test against without there being skips for their records. See header file `posix/semaphore.h` under `rtos/qurt/computev81` in the Hexagon SDK for details. (backport <rust-lang#5351>) (cherry picked from commit 471be3d)
|
3b624ac as well, breaking change |
Remove check for `cpuid_info` as a `union` as that dates back to the times where Rust didn't itself have `union`s so this type had to be implemented as a `struct`. Skipping it in libc-test's build script is redundant. The same applies to `cpu_topology_node_info`. (backport <rust-lang#5351>) (cherry picked from commit 12fe28d)
Replace dummy field for `union` with an actual definition fitting that of the upstream type. The current (pre-patch) field corresponded with the times back when Rust didn't have `union`s. Now it's not necessary anymore to expose only a single field of the `union`. The corresponding skip in libc-test's build script has also been removed. (backport <rust-lang#5351>) (cherry picked from commit 97ad377)
Remove a skip over `sigaction` in Hexagon QuRT as it seems the separate fields in Rust mentioned in libc-test's build script's skip aligns well with the (also) split fields upstream. See header file `posix/signal.h` under `rtos/qurt/computev81` in the Hexagon SDK. (backport <rust-lang#5351>) (cherry picked from commit 96baf11)
Remove skip over `sem_t` in Hexagon QuRT as it alleged to this being a `typedef` of an anonymous `struct`, but that also happens in other targets we test against without there being skips for their records. See header file `posix/semaphore.h` under `rtos/qurt/computev81` in the Hexagon SDK for details. (backport <rust-lang#5351>) (cherry picked from commit 471be3d)
|
Not sure if we can close #1020 already, or if we should wait until we |
|
Good call, I think we can close that. As long as there aren't other union-related mismatches. |
Description
This PR tries to address issue #1020. It cleans up a bunch of old ctest skips
over fields and types that were previously (more than six years ago) not proper
unions.Note as well that
_channel_connect_attrin QNX I couldn't check even though itseems like it may be some left over
struct-as-uniontype. I just coulnd'tget access to the SDK in the QNX site.
Then there's an unnamed field that is itself a
unionin Haiku targets undersigaction. I've not changed that one because I don't know of a way of handlinga combination of both unnamed
unionand unnamed field.The same applies to
cpu_topology_node_infoin Haiku targets.For details on the rest of the changes, see the patch messages.
Checklist
libc-test/semverhave been updated*LASTor*MAXhave the standarddoc comment
cargo test -p libc-test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated