diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index acdf0bf0658..870fa0ec53f 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -359,7 +359,7 @@ impl RawPtr for *T { if self.is_null() { None } else { - Some(mem::transmute(*self)) + Some(&**self) } } } @@ -384,7 +384,7 @@ impl RawPtr for *mut T { if self.is_null() { None } else { - Some(mem::transmute(*self)) + Some(&**self) } } }