Disable main_needs_argc_argv for Wasm#156571
Open
daxpedda wants to merge 1 commit into
Open
Conversation
Collaborator
|
These commits modify compiler targets. |
Member
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
May 14, 2026
Disable `main_needs_argc_argv` for Wasm AFAIU this explains to the "Rust Runtime" that `main()` doesn't need `argc`/`argv`. Newer Wasm targets have explicitly disabled this, this PR changes it so that the base Wasm configuration affecting all Wasm targets disables this now. This affects the following targets: - `wasm32-unknown-unknown` - `wasm32v1-none` - `wasm64-unknown-unknown` The only Wasm target where `main_needs_argc_argv` is still enabled is `wasm32-unknown-emscripten`. @hoodmane let me know and I can remove it there as well. Credit goes to @Spxg for stumbling on this. r? @alexcrichton
Contributor
|
Emscripten uses this so we do want to keep it. |
Member
|
@bors r- |
Contributor
|
This pull request was unapproved. This PR was contained in a rollup (#156574), which was unapproved. |
Contributor
Author
|
That's okay @alexcrichton, the PR doesn't modify the Emscripten target. I deliberately only covered the unknown/none ones. |
Member
|
The Emscripten target inherits from the |
Contributor
Author
|
I just wanted to write that it doesn't, but double-checked and it does: All the other targets start with that, Emscripten ended with it, which is why I missed it. Sorry! Fixed now. |
Member
|
@bors r+ |
Contributor
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
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.
AFAIU this explains to the "Rust Runtime" that
main()doesn't needargc/argv. Newer Wasm targets have explicitly disabled this, this PR changes it so that the base Wasm configuration affecting all Wasm targets disables this now.This affects the following targets:
wasm32-unknown-unknownwasm32v1-nonewasm64-unknown-unknownThe only Wasm target where
main_needs_argc_argvis still enabled iswasm32-unknown-emscripten. @hoodmane let me know and I can remove it there as well.Credit goes to @Spxg for stumbling on this.
r? @alexcrichton