Skip to content
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

Export public scalar statics in wasm #67975

Merged
merged 6 commits into from
Jan 9, 2020

Conversation

MaikKlein
Copy link
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
Collaborator

r? @eddyb

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 7, 2020
@alexcrichton
Copy link
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
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 force-pushed the export-statics-wasm branch from 474b108 to eddb3f0 Compare January 7, 2020 18:42
@MaikKlein MaikKlein marked this pull request as ready for review January 7, 2020 18:46
@MaikKlein MaikKlein force-pushed the export-statics-wasm branch from eddb3f0 to 093fb85 Compare January 8, 2020 08:40
@MaikKlein
Copy link
Contributor Author

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

@alexcrichton
Copy link
Member

@bors: r+

Nice!

@bors
Copy link
Contributor

bors commented Jan 8, 2020

📌 Commit f1fb384 has been approved by alexcrichton

@bors bors 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

Fixes rust-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.
Centril added a commit to Centril/rust that referenced this pull request Jan 9, 2020
…r=alexcrichton

Export public scalar statics in wasm

Fixes rust-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.
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

Fixes rust-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.
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:master Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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