rust-ctor
rust-ctor copied to clipboard
Support #[ctor] on wasm target
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 https://github.com/dtolnay/typetag/issues/8 for a failing repro that shows ctor functions not being invoked.
@cwhakes may be able to help with the implementation or testing.
Ah, seems to be blocked on https://github.com/rustwasm/wasm-bindgen/issues/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.
I'll leave this one open for now as a tracking issue. Thanks for filing it.
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
.
https://github.com/rust-lang/rust/issues/82371
Sorry. I am no longer working on rust-ctor
support. Going to explore a different approach instead -> https://github.com/rust-lang/rust/issues/82371#issuecomment-782907947
Closing as I would no longer plan to use this in the typetag crate, which was the original motivation.