Skip to content

Commit dbeea14

Browse files
committed
Fix an unnecessary use of cast::transmute
Wherever possible, more specialized variants of said functions should be used, such as in this case `cast::transmute_mmut_unsafe`.
1 parent 94a055c commit dbeea14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<T> Unsafe<T> {
6363

6464
/// Gets a mutable pointer to the wrapped value
6565
#[inline]
66-
pub unsafe fn get(&self) -> *mut T { cast::transmute(&self.value) }
66+
pub unsafe fn get(&self) -> *mut T { cast::transmute_mut_unsafe(&self.value) }
6767

6868
/// Unwraps the value
6969
#[inline]

0 commit comments

Comments
 (0)