Skip to content

Commit f3adee7

Browse files
committed
Squash warnings about unused variables
Make sure when compiling for non-wasm targets we don't issue tons of warnings about unused variables which can't be squashed.
1 parent c876bd6 commit f3adee7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/backend/src/codegen.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl ToTokens for ast::Struct {
210210
}
211211

212212
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
213-
unsafe fn #new_fn(ptr: u32) -> u32 {
213+
unsafe fn #new_fn(_: u32) -> u32 {
214214
panic!("cannot convert to JsValue outside of the wasm target")
215215
}
216216

@@ -719,7 +719,7 @@ impl ToTokens for ast::ImportType {
719719
fn #instanceof_shim(val: u32) -> u32;
720720
}
721721
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
722-
unsafe fn #instanceof_shim(val: u32) -> u32 {
722+
unsafe fn #instanceof_shim(_: u32) -> u32 {
723723
panic!("cannot check instanceof on non-wasm targets");
724724
}
725725
unsafe {
@@ -997,6 +997,7 @@ impl TryToTokens for ast::ImportFunction {
997997
let attrs = &self.function.rust_attrs;
998998
let arguments = &arguments;
999999
let abi_arguments = &abi_arguments;
1000+
let abi_argument_names = &abi_argument_names;
10001001

10011002
let doc_comment = match &self.doc_comment {
10021003
None => "",
@@ -1032,6 +1033,7 @@ impl TryToTokens for ast::ImportFunction {
10321033
}
10331034
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
10341035
unsafe fn #import_name(#(#abi_arguments),*) -> #abi_ret {
1036+
drop((#(#abi_argument_names),*));
10351037
panic!("cannot call wasm-bindgen imported functions on \
10361038
non-wasm targets");
10371039
}

0 commit comments

Comments
 (0)