Fix warnings about missing dyn on trait objects

This commit is contained in:
Nick Fitzgerald 2019-07-11 13:26:46 -07:00
parent c21c85a7ff
commit 6252c7ab78
2 changed files with 3 additions and 3 deletions

View File

@ -54,8 +54,8 @@ pub mod strings;
#[wasm_bindgen_test] #[wasm_bindgen_test]
fn closures_work() { fn closures_work() {
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>); let x = Closure::wrap(Box::new(|| {}) as Box<dyn FnMut()>);
drop(x); drop(x);
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>); let x = Closure::wrap(Box::new(|| {}) as Box<dyn FnMut()>);
x.forget(); x.forget();
} }

View File

@ -3,7 +3,7 @@ use wasm_bindgen_test::*;
#[wasm_bindgen(module = "/tests/headless/strings.js")] #[wasm_bindgen(module = "/tests/headless/strings.js")]
extern "C" { extern "C" {
fn test_string_roundtrip(c: &Closure<Fn(String) -> String>); fn test_string_roundtrip(c: &Closure<dyn Fn(String) -> String>);
} }
#[wasm_bindgen_test] #[wasm_bindgen_test]