From 1ba298548fa0ec8be86e8a684f7988043a966f8b Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 9 Jul 2019 13:17:34 -0700 Subject: [PATCH 1/2] Fix warning about unnecessary parens in generated code --- crates/backend/src/codegen.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/backend/src/codegen.rs b/crates/backend/src/codegen.rs index 51144931..abf7eecd 100644 --- a/crates/backend/src/codegen.rs +++ b/crates/backend/src/codegen.rs @@ -977,7 +977,9 @@ impl TryToTokens for ast::ImportFunction { } #[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))] unsafe fn #import_name(#(#abi_arguments),*) -> #abi_ret { - drop((#(#abi_argument_names),*)); + #( + drop(#abi_argument_names); + )* panic!("cannot call wasm-bindgen imported functions on \ non-wasm targets"); } From 6cb659d5aca8b7f79a63ef03a2329f21a9e0d8da Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 9 Jul 2019 13:17:52 -0700 Subject: [PATCH 2/2] Fix warning about dead code when testing on non-wasm32 targets There are functions that are only used on wasm32 targets, but `cfg`ing them is more work than just making the modules public, and this is just a testing crate. --- crates/typescript-tests/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/typescript-tests/src/lib.rs b/crates/typescript-tests/src/lib.rs index 07047ff5..211dfff6 100644 --- a/crates/typescript-tests/src/lib.rs +++ b/crates/typescript-tests/src/lib.rs @@ -1,5 +1,5 @@ -mod custom_section; -mod getters_setters; -mod opt_args_and_ret; -mod simple_fn; -mod simple_struct; +pub mod custom_section; +pub mod getters_setters; +pub mod opt_args_and_ret; +pub mod simple_fn; +pub mod simple_struct;