Skip to content

Commit

Permalink
Fix CI (#3853)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda authored Feb 23, 2024
1 parent 557e2e6 commit 0c09e15
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 1 addition & 3 deletions tests/wasm/classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,7 @@ impl RenamedExport {
}
pub fn foo(&self) {}

pub fn bar(&self, other: &RenamedExport) {
drop(other);
}
pub fn bar(&self, _: &RenamedExport) {}
}

#[wasm_bindgen_test]
Expand Down
20 changes: 15 additions & 5 deletions tests/wasm/closures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ fn drop_drops() {
}
}
let a = A;
let x: Closure<dyn Fn()> = Closure::new(move || drop(&a));
let x: Closure<dyn Fn()> = Closure::new(move || {
let _ = a;
});
drop(x);
unsafe {
assert!(HIT);
Expand Down Expand Up @@ -605,25 +607,33 @@ fn call_destroyed_doesnt_segfault() {
}

let a = A(1, 1);
let a = Closure::wrap(Box::new(move || drop(&a)) as Box<dyn Fn()>);
let a = Closure::wrap(Box::new(move || {
let _ = a;
}) as Box<dyn Fn()>);
let b = a.as_ref().clone();
drop(a);
call_destroyed(&b);

let a = A(2, 2);
let a = Closure::wrap(Box::new(move || drop(&a)) as Box<dyn FnMut()>);
let a = Closure::wrap(Box::new(move || {
let _ = a;
}) as Box<dyn FnMut()>);
let b = a.as_ref().clone();
drop(a);
call_destroyed(&b);

let a = A(1, 1);
let a = Closure::wrap(Box::new(move |_: &JsValue| drop(&a)) as Box<dyn Fn(&JsValue)>);
let a = Closure::wrap(Box::new(move |_: &JsValue| {
let _ = a;
}) as Box<dyn Fn(&JsValue)>);
let b = a.as_ref().clone();
drop(a);
call_destroyed(&b);

let a = A(2, 2);
let a = Closure::wrap(Box::new(move |_: &JsValue| drop(&a)) as Box<dyn FnMut(&JsValue)>);
let a = Closure::wrap(Box::new(move |_: &JsValue| {
let _ = a;
}) as Box<dyn FnMut(&JsValue)>);
let b = a.as_ref().clone();
drop(a);
call_destroyed(&b);
Expand Down

0 comments on commit 0c09e15

Please sign in to comment.