Skip to content

Commit 9539be6

Browse files
committed
auto merge of #13343 : tbu-/rust/pr_smallfix, r=pcwalton
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`.
2 parents 5dacd11 + dbeea14 commit 9539be6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/ty.rs

+1-1
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)