Return *const T from JS::unsafe_get() (fixes #4712).

This commit is contained in:
Ms2ger 2015-01-24 16:36:54 +01:00
parent 4c9d7ce5d0
commit 801949556d
2 changed files with 5 additions and 7 deletions

View file

@ -311,8 +311,8 @@ impl<T: Reflectable> JS<T> {
/// 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 {
self.ptr as *mut T
pub unsafe fn unsafe_get(&self) -> *const T {
self.ptr
}
/// Store an unrooted value in this field. This is safe under the assumption that JS<T>