diff --git a/crates/backend/src/codegen.rs b/crates/backend/src/codegen.rs index d71ff6bdc..99c7aec42 100644 --- a/crates/backend/src/codegen.rs +++ b/crates/backend/src/codegen.rs @@ -129,7 +129,7 @@ impl ToTokens for ast::Struct { impl ::wasm_bindgen::convert::FromWasmAbi for #name { type Abi = u32; - unsafe fn from_abi(js: u32, extra: &mut ::wasm_bindgen::convert::Stack) + unsafe fn from_abi(js: u32, _extra: &mut ::wasm_bindgen::convert::Stack) -> Self { let ptr = js as *mut ::wasm_bindgen::__rt::WasmRefCell<#name>; diff --git a/tests/all/classes.rs b/tests/all/classes.rs index b388a5dfa..c96593f65 100644 --- a/tests/all/classes.rs +++ b/tests/all/classes.rs @@ -291,13 +291,13 @@ fn issue_27() { #[wasm_bindgen] impl Context { - pub fn parse(&self, expr: &str) -> Expr { + pub fn parse(&self, _expr: &str) -> Expr { panic!() } - pub fn eval(&self, expr: &Expr) -> f64 { + pub fn eval(&self, _expr: &Expr) -> f64 { panic!() } - pub fn set(&mut self, var: &str, val: f64) { + pub fn set(&mut self, _var: &str, _val: f64) { panic!() } } diff --git a/tests/all/closures.rs b/tests/all/closures.rs index 0cac95c94..d965091c1 100644 --- a/tests/all/closures.rs +++ b/tests/all/closures.rs @@ -294,7 +294,6 @@ fn long_fnmut_recursive() { extern crate wasm_bindgen; - use std::cell::Cell; use wasm_bindgen::prelude::*; #[wasm_bindgen(module = "./test")] @@ -336,7 +335,6 @@ fn fnmut() { extern crate wasm_bindgen; - use std::cell::Cell; use wasm_bindgen::prelude::*; #[wasm_bindgen(module = "./test")] @@ -385,7 +383,6 @@ fn fnmut_bad() { extern crate wasm_bindgen; - use std::cell::Cell; use wasm_bindgen::prelude::*; #[wasm_bindgen(module = "./test")] @@ -441,7 +438,6 @@ fn string_arguments() { extern crate wasm_bindgen; - use std::cell::Cell; use wasm_bindgen::prelude::*; #[wasm_bindgen(module = "./test")] diff --git a/tests/all/imports.rs b/tests/all/imports.rs index b464e0898..3cd4f7fca 100644 --- a/tests/all/imports.rs +++ b/tests/all/imports.rs @@ -87,6 +87,7 @@ fn unused() { project() .file("src/lib.rs", r#" #![feature(proc_macro, wasm_custom_section, wasm_import_module)] + #![allow(dead_code)] extern crate wasm_bindgen; diff --git a/tests/all/main.rs b/tests/all/main.rs index 27fcdaa97..8c7aac10a 100644 --- a/tests/all/main.rs +++ b/tests/all/main.rs @@ -169,7 +169,9 @@ impl Project { .arg("--target") .arg("wasm32-unknown-unknown") .current_dir(&root) - .env("CARGO_TARGET_DIR", &target_dir); + .env("CARGO_TARGET_DIR", &target_dir) + // Catch any warnings in generated code because we don't want any + .env("RUSTFLAGS", "-Dwarnings"); run(&mut cmd, "cargo"); let idx = IDX.with(|x| *x);