-
Notifications
You must be signed in to change notification settings - Fork 13.9k
std: reorganize the UNIX-internal weak module
#146629
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
Merged
Merged
+232
−270
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
This comment has been minimized.
This comment has been minimized.
de0f81e to
e806929
Compare
This comment has been minimized.
This comment has been minimized.
e806929 to
0af3db5
Compare
ibraheemdev
reviewed
Oct 14, 2025
|
Looks good. r=me after the nit. |
0af3db5 to
e043a0b
Compare
|
@bors r+ |
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Oct 22, 2025
std: reorganize the UNIX-internal `weak` module This moves the `dlsym`-based and weak-linkage versions of the `weak!` macro into separate files, both of which include a common test file. As a result, both versions will be tested on all the platforms where they are used. Since the `#[link_name]` arm of the `dlsym` version was unused, I've removed it. I've also removed the unused `raw_syscall!` and non-Linux `syscall!` macros and gated the `#[allow(dead_code, unused_macros)]` to only apply on non-Linux platforms, so compilation will fail if `weak` turns out to be unused on all platforms. The last change concerns the use of `dlsym!` on FreeBSD: it is only used once, to link against `sysctlbyname`. But that symbol is always available, so there is no need for weak linkage.
This was referenced Oct 22, 2025
bors
added a commit
that referenced
this pull request
Oct 23, 2025
Rollup of 4 pull requests Successful merges: - #115501 (Add new inherit_handles flag to CommandExt trait) - #146629 (std: reorganize the UNIX-internal `weak` module) - #147762 (feat(rustdoc): `--emit=depinfo` output to stdout via `-`) - #148001 (fix: Don't add diff symbol to unchanged lines) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Oct 23, 2025
Rollup merge of #146629 - joboet:reorganize-weak, r=ibraheemdev std: reorganize the UNIX-internal `weak` module This moves the `dlsym`-based and weak-linkage versions of the `weak!` macro into separate files, both of which include a common test file. As a result, both versions will be tested on all the platforms where they are used. Since the `#[link_name]` arm of the `dlsym` version was unused, I've removed it. I've also removed the unused `raw_syscall!` and non-Linux `syscall!` macros and gated the `#[allow(dead_code, unused_macros)]` to only apply on non-Linux platforms, so compilation will fail if `weak` turns out to be unused on all platforms. The last change concerns the use of `dlsym!` on FreeBSD: it is only used once, to link against `sysctlbyname`. But that symbol is always available, so there is no need for weak linkage.
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this pull request
Oct 27, 2025
Rollup of 4 pull requests Successful merges: - rust-lang/rust#115501 (Add new inherit_handles flag to CommandExt trait) - rust-lang/rust#146629 (std: reorganize the UNIX-internal `weak` module) - rust-lang/rust#147762 (feat(rustdoc): `--emit=depinfo` output to stdout via `-`) - rust-lang/rust#148001 (fix: Don't add diff symbol to unchanged lines) r? `@ghost` `@rustbot` modify labels: rollup
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This moves the
dlsym-based and weak-linkage versions of theweak!macro into separate files, both of which include a common test file. As a result, both versions will be tested on all the platforms where they are used.Since the
#[link_name]arm of thedlsymversion was unused, I've removed it. I've also removed the unusedraw_syscall!and non-Linuxsyscall!macros and gated the#[allow(dead_code, unused_macros)]to only apply on non-Linux platforms, so compilation will fail ifweakturns out to be unused on all platforms.The last change concerns the use of
dlsym!on FreeBSD: it is only used once, to link againstsysctlbyname. But that symbol is always available, so there is no need for weak linkage.