mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 05:52:21 +03:00
Fix exporting structs with BorrowMut
in scope
Apparently the codegen wasn't precise enough such that a trait import could cause method resolution to go awry! Closes #919
This commit is contained in:
parent
7ec1511d3d
commit
32b62b4358
@ -165,7 +165,7 @@ impl ToTokens for ast::Struct {
|
|||||||
let ptr = js as *mut WasmRefCell<#name>;
|
let ptr = js as *mut WasmRefCell<#name>;
|
||||||
assert_not_null(ptr);
|
assert_not_null(ptr);
|
||||||
let js = Box::from_raw(ptr);
|
let js = Box::from_raw(ptr);
|
||||||
js.borrow_mut(); // make sure no one's borrowing
|
(*js).borrow_mut(); // make sure no one's borrowing
|
||||||
js.into_inner()
|
js.into_inner()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#[allow(unused_imports)] // test for #919
|
||||||
|
use std::borrow::BorrowMut;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user