-
Notifications
You must be signed in to change notification settings - Fork 13.6k
library/windows_targets: Fix macro expansion error in 'link' macro #144415
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
Closed
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
A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in rust-lang#143592 This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon". We also modify the non windows_raw_dylib link to make use of the link_dylib macro
rustbot has assigned @Mark-Simulacrum. Use |
The job Click to see the possible cause of the failure (guessed by this bot)
|
itf
added a commit
to itf/rust
that referenced
this pull request
Jul 24, 2025
…st-lang#144415 A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in rust-lang#143592 This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon". We revert this change, making it consistent with the link! macro when the windows_raw_dylib feature is not enabled. For the case when it is not enabled, it also makes use of code repetition in order to avoid the macro expansion error. If instead we try to reuse the code, as seen in rust-lang#144415, we run into the same issue of "macros that expand to items must be delimited with braces or followed by a semicolon"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in #143592
This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon".
We also modify the non windows_raw_dylib link to make use of the link_dylib macro