mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Don't call transmute_copy in JS::unsafe_get.
It hasn't had borrow flags for quite a while.
This commit is contained in:
parent
d9c2bfae87
commit
dfbf83a8ac
1 changed files with 4 additions and 4 deletions
|
@ -308,11 +308,11 @@ impl<T: Reflectable> MutNullableJS<T> {
|
|||
}
|
||||
|
||||
impl<T: Reflectable> JS<T> {
|
||||
/// Returns an unsafe pointer to the interior of this JS object without touching the borrow
|
||||
/// flags. This is the only method that be safely accessed from layout. (The fact that this
|
||||
/// is unsafe is what necessitates the layout wrappers.)
|
||||
/// Returns an unsafe pointer to the interior of this object. This is the
|
||||
/// only method that be safely accessed from layout. (The fact that this is
|
||||
/// unsafe is what necessitates the layout wrappers.)
|
||||
pub unsafe fn unsafe_get(&self) -> *mut T {
|
||||
mem::transmute_copy(&self.ptr)
|
||||
self.ptr as *mut T
|
||||
}
|
||||
|
||||
/// Store an unrooted value in this field. This is safe under the assumption that JS<T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue