Skip to content

Conversation

@daxpedda
Copy link
Contributor

@daxpedda daxpedda commented Dec 16, 2025

This change makes it possible to use unstable asm!, usually requiring feature(asm_experimental_arch), in proc-macros with the allow_internal_unstable attribute.

The test was added on a target where asm! is unstable: Wasm. However, this affects any target with an unstable asm! implementation.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 16, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
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

Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

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

I have some questions.

  • What's the motivation for this? Did it come up in a particular real-world context?
  • Presumably targets with stable asm!/global_asm! are unaffected by this?
  • The PR description mentions proc macros, but the test uses a declarative macro. Why is this?

I'm also wondering if this will need some kind of libs/lang approval.

View changes since this review

@nnethercote nnethercote added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 16, 2025
@daxpedda
Copy link
Contributor Author

daxpedda commented Dec 16, 2025

  • What's the motivation for this? Did it come up in a particular real-world context?

Yes, we are planning to use this in wasm-bindgen.

Currently we encode a bunch of information in really strange ways into the Wasm module and we are planning to make the next version of wasm-bindgen transition to using inline ASM instead. Until it is stabilized, we will basically build a replica of global_asm! ourselves, but we will dynamically detect nightly and switch to use Std's global_asm! instead to future-proof ourselves.

  • Presumably targets with stable asm!/global_asm! are unaffected by this?

Yes, this only affects targets requiring asm_experimental_arch: #93335.

  • The PR description mentions proc macros, but the test uses a declarative macro. Why is this?

The mechanism is the same, I've double-checked by trying it out locally.
The reason why I didn't add a proc-macro test is because I was just following existing tests for allow_internal_unstable.

Happy to add a dedicated proc-macro test!

@daxpedda daxpedda requested a review from nnethercote December 16, 2025 22:30
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 16, 2025
@nnethercote
Copy link
Contributor

No need to add a proc macro test. I'll just check on Zulip if we need any kind of libs/lang sign-off, otherwise this looks ok to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants