Skip to content

Commit

Permalink
auto merge of rust-lang#13343 : tbu-/rust/pr_smallfix, r=pcwalton
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
bors committed Apr 5, 2014
2 parents 5dacd11 + dbeea14 commit 9539be6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<T> Unsafe<T> {

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

/// Unwraps the value
#[inline]
Expand Down

0 comments on commit 9539be6

Please sign in to comment.