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

Support #[ctor] on wasm target #14

Closed
dtolnay opened this issue Apr 8, 2019 · 5 comments
Closed

Support #[ctor] on wasm target #14

dtolnay opened this issue Apr 8, 2019 · 5 comments
Labels
blocked Blocked by another project enhancement New feature or request

Comments

@dtolnay
Copy link
Contributor

dtolnay commented Apr 8, 2019

I don't know for sure that this is possible, but it seems likely because C++ compiled to wasm would need to support static initializers somehow.

I would love to use this for typetag -- see dtolnay/typetag#8 for a failing repro that shows ctor functions not being invoked.

@cwhakes may be able to help with the implementation or testing.

@dtolnay
Copy link
Contributor Author

dtolnay commented Apr 8, 2019

Ah, seems to be blocked on rustwasm/wasm-bindgen#1216. If you prefer, feel free to close for now and I can follow up later when the necessary functionality has landed in wasm-bindgen.

@mmastrac
Copy link
Owner

I'll leave this one open for now as a tracking issue. Thanks for filing it.

@chinedufn
Copy link

I'm working on landing support for this in rustc, then wasm-bindgen, then I'd be happy to submit a PR to rust-ctor.

rust-lang/rust#82371

@chinedufn
Copy link

Sorry. I am no longer working on rust-ctor support. Going to explore a different approach instead -> rust-lang/rust#82371 (comment)

@dtolnay
Copy link
Contributor Author

dtolnay commented Jan 16, 2023

Closing as I would no longer plan to use this in the typetag crate, which was the original motivation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by another project enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants