Work with #![no_std] contexts

This commit adds support for both `#![no_std]` in the wasm-bindgen runtime
support (disabled by default with an on-by-default `std` feature). This also
adds support to work and compile in the context of `#![no_std]` crates.

Closes #146
This commit is contained in:
Alex Crichton
2018-04-19 13:08:54 -07:00
parent 792a8e132e
commit 748184ae66
11 changed files with 318 additions and 127 deletions

View File

@ -91,9 +91,7 @@ impl<'a, 'b> Rust2Js<'a, 'b> {
self.prelude(&format!("\
wasm.__wbindgen_free(arg{0}, len{0} * {size});\
", i, size = ty.size()));
self.cx.required_internal_exports.insert(
"__wbindgen_free"
);
self.cx.require_internal_export("__wbindgen_free");
}
self.js_arguments.push(format!("v{}", i));
return