Don't call transmute_copy in JS::unsafe_get.

It hasn't had borrow flags for quite a while.
This commit is contained in:
Ms2ger 2015-01-24 15:57:09 +01:00
parent d9c2bfae87
commit dfbf83a8ac

View file

@ -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>