Skip to content

Conversation

@tgross35
Copy link
Contributor

@tgross35 tgross35 commented Oct 22, 2025

Details are in the commit messages

Really what we are indicating with this macro invocation is that we need
a type that can be specified behind indirection but never used directly,
which is an extern type. Using an uninhabited enum gets us most of the
way there and is about the best we can do for now.
Use the macro to replace repeated handwritten uninhabited enums. In
order to keep the same traits, `extern_ty!` now implements `Clone` and
`Copy` in addition to the existing `Debug`, which affects existing uses
of `extern_ty!`. We don't need these traits since they can never be used
on uninhabited types, but there is no harm in adding them for now and
dropping later on.
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Oct 23, 2025
@tgross35 tgross35 marked this pull request as ready for review October 23, 2025 05:48
@rustbot
Copy link
Collaborator

rustbot commented Oct 23, 2025

Some changes occurred in solarish module

cc @jclulow, @pfmooney

Some changes occurred in OpenBSD module

cc @semarie

@tgross35 tgross35 enabled auto-merge October 23, 2025 05:51
@tgross35 tgross35 added this pull request to the merge queue Oct 23, 2025
Merged via the queue into rust-lang:main with commit 147b462 Oct 23, 2025
51 of 52 checks passed
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 3, 2025
Really what we are indicating with this macro invocation is that we need
a type that can be specified behind indirection but never used directly,
which is an extern type. Using an uninhabited enum gets us most of the
way there and is about the best we can do for now.

(backport <rust-lang#4759>)
(cherry picked from commit fe5ecb8)
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 3, 2025
Use the macro to replace repeated handwritten uninhabited enums. In
order to keep the same traits, `extern_ty!` now implements `Clone` and
`Copy` in addition to the existing `Debug`, which affects existing uses
of `extern_ty!`. We don't need these traits since they can never be used
on uninhabited types, but there is no harm in adding them for now and
dropping later on.

(backport <rust-lang#4759>)
(cherry picked from commit 147b462)
@tgross35 tgross35 mentioned this pull request Nov 3, 2025
@tgross35 tgross35 deleted the extern-macros branch November 3, 2025 10:21
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 3, 2025
Really what we are indicating with this macro invocation is that we need
a type that can be specified behind indirection but never used directly,
which is an extern type. Using an uninhabited enum gets us most of the
way there and is about the best we can do for now.

(backport <rust-lang#4759>)
(cherry picked from commit fe5ecb8)
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 3, 2025
Use the macro to replace repeated handwritten uninhabited enums. In
order to keep the same traits, `extern_ty!` now implements `Clone` and
`Copy` in addition to the existing `Debug`, which affects existing uses
of `extern_ty!`. We don't need these traits since they can never be used
on uninhabited types, but there is no harm in adding them for now and
dropping later on.

(backport <rust-lang#4759>)
(cherry picked from commit 147b462)
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2025
Really what we are indicating with this macro invocation is that we need
a type that can be specified behind indirection but never used directly,
which is an extern type. Using an uninhabited enum gets us most of the
way there and is about the best we can do for now.

(backport <#4759>)
(cherry picked from commit fe5ecb8)
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2025
Use the macro to replace repeated handwritten uninhabited enums. In
order to keep the same traits, `extern_ty!` now implements `Clone` and
`Copy` in addition to the existing `Debug`, which affects existing uses
of `extern_ty!`. We don't need these traits since they can never be used
on uninhabited types, but there is no harm in adding them for now and
dropping later on.

(backport <#4759>)
(cherry picked from commit 147b462)
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants