wasm-tools
wasm-tools copied to clipboard
Make wasmparser compile for #![no_std]
This make makes the wasmparser crate successfully compile for no-std platforms.
The PR was very mechanical, but feel free to reject if this is out of scope of the repository.
I've added an std feature just because of a single impl std::error::Error for ... {}.
My personal opinion would be to ditch this impl and the std feature entirely, but I went for the non-breaking option. Let me know if I should do this.
I left a comment on a similar PR as well for Wasmtime, and I'd personally prefer to resolve it there first before figuring out whether or not to merge this.
@tomaka FYI I published a no_std compatible wasmparser crate here: https://crates.io/crates/wasmparser-nostd (in case you still need this)
It also switches out Hash{Map,Set} with BTree{Map,Set} internally so that the implementation is not attackable in no_std environment. Enable no_std by disabling default features (--no-default-features) as usual.
I think we can close this PR.
- It is outdated.
- We already have an open issue that informs people about
no_stdsupport inwasmparseret. al. - The issue contains a link to the actual
wasmparser-nostdfork that I maintain since a while.
Sounds good.