Skip to content

Export public scalar statics in wasm - #67975

Merged
bors merged 6 commits into
rust-lang:masterfrom
EmbarkStudios:export-statics-wasm
Jan 9, 2020
Merged

Export public scalar statics in wasm#67975
bors merged 6 commits into
rust-lang:masterfrom
EmbarkStudios:export-statics-wasm

Conversation

@MaikKlein

Copy link
Copy Markdown
Contributor

Fixes#67453

I am not sure which export level statics should get when exporting them in wasm. This small change fixes the issue that I had, but this might not be the correct way to implement this.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 7, 2020
@alexcrichton

Copy link
Copy Markdown
Member

I think that the case for wasm can be removed entirely here since I believe the exported value is always the address of the variable in memory

@alexcrichton

Copy link
Copy Markdown
Member

I think that this is probably ok to land, but can you add some wasm-specific tests (probably around src/test/run-make, copying existing ones), which assert that statics work as expected?

@MaikKlein
MaikKlein marked this pull request as ready for review January 7, 2020 18:46
@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

Added a very basic test to wasm-export-all-symbols, instead of creating a new one.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

Nice!

@bors

bors commented Jan 8, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit f1fb384 has been approved by alexcrichton

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 8, 2020
Centril added a commit to Centril/rust that referenced this pull request Jan 9, 2020
…r=alexcrichton
Export public scalar statics in wasm
Fixesrust-lang#67453
I am not sure which export level statics should get when exporting them in wasm. This small change fixes the issue that I had, but this might not be the correct way to implement this.
@CentrilCentril mentioned this pull request Jan 9, 2020
Centril added a commit to Centril/rust that referenced this pull request Jan 9, 2020
…r=alexcrichton
Export public scalar statics in wasm
Fixesrust-lang#67453
I am not sure which export level statics should get when exporting them in wasm. This small change fixes the issue that I had, but this might not be the correct way to implement this.
@CentrilCentril mentioned this pull request Jan 9, 2020
bors added a commit that referenced this pull request Jan 9, 2020
Rollup of 6 pull requests
Successful merges:
- #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)
- #67358 (Add HashSet::get_or_insert_owned)
- #67935 (Relax the Sized bounds on Pin::map_unchecked(_mut))
- #67975 (Export public scalar statics in wasm)
- #67988 (Change -Z time event naming scheme and make them generic activities)
- #68006 (Recognise riscv64 in compiletest)
Failed merges:
- #67806 (Extract `rustc_ast_passes`, move gating, & refactor linting)
r? @ghost
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 9, 2020
…r=alexcrichton
Export public scalar statics in wasm
Fixesrust-lang#67453
I am not sure which export level statics should get when exporting them in wasm. This small change fixes the issue that I had, but this might not be the correct way to implement this.
@JohnTitorJohnTitor mentioned this pull request Jan 9, 2020
bors added a commit that referenced this pull request Jan 9, 2020
Rollup of 10 pull requests
Successful merges:
- #66254 (Make Layout::new const)
- #67122 (Do not deduplicate diagnostics in UI tests)
- #67358 (Add HashSet::get_or_insert_owned)
- #67725 (Simplify into_key_slice_mut)
- #67935 (Relax the Sized bounds on Pin::map_unchecked(_mut))
- #67967 (Delay bug to prevent ICE in MIR borrowck)
- #67975 (Export public scalar statics in wasm)
- #68006 (Recognise riscv64 in compiletest)
- #68040 (Cleanup)
- #68054 (doc: add Null-unchecked version section to mut pointer as_mut method)
Failed merges:
- #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)
r? @ghost
@bors
bors merged commit f1fb384 into rust-lang:masterJan 9, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static variables are not exported in wasm

5 participants

@MaikKlein@rust-highfive@alexcrichton@bors@eddyb