Merge pull request #920 from alexcrichton/fix-borrow-mut

Fix exporting structs with `BorrowMut` in scope
This commit is contained in:
Alex Crichton 2018-10-03 09:09:36 -07:00 committed by GitHub
commit 4a5e13b08b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,7 @@ impl ToTokens for ast::Struct {
let ptr = js as *mut WasmRefCell<#name>;
assert_not_null(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()
}
}

View File

@ -1,3 +1,6 @@
#[allow(unused_imports)] // test for #919
use std::borrow::BorrowMut;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;