Fix compat with current nightly

This commit is contained in:
Alex Crichton
2018-04-26 19:12:56 -07:00
parent 6d5ebaf5ac
commit b7bbcf5ea9
2 changed files with 21 additions and 11 deletions

View File

@ -109,6 +109,13 @@ impl ToTokens for ast::Struct {
(quote! {
impl ::wasm_bindgen::describe::WasmDescribe for #name {
fn describe() {
use wasm_bindgen::__wbindgen_if_not_std;
__wbindgen_if_not_std! {
compile_error! {
"exporting a class to JS requires the `std` feature to \
be enabled in the `wasm-bindgen` crate"
}
}
use wasm_bindgen::describe::*;
inform(RUST_STRUCT);
inform(#name_len);
@ -116,13 +123,6 @@ impl ToTokens for ast::Struct {
}
}
::wasm_bindgen::__wbindgen_if_not_std! {
compile_error! {
"exporting a class to JS requires the `std` feature to \
be enabled in the `wasm-bindgen` crate"
}
}
impl ::wasm_bindgen::convert::IntoWasmAbi for #name {
type Abi = u32;