Skip to content

Commit

Permalink
Merge pull request #5 from SimonSapin/patch-1
Browse files Browse the repository at this point in the history
transmute doesn’t need to be called to do its size check
  • Loading branch information
nvzqz committed Nov 8, 2017
2 parents 30f88bc + c3e8447 commit d67cb97
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ macro_rules! assert_eq_size {
($x:ty, $($xs:ty),+ $(,)*) => {
#[allow(unknown_lints, forget_copy, unused_unsafe, useless_transmute)]
unsafe {
use $crate::_core::mem::{forget, transmute, uninitialized};
$(forget::<$xs>(transmute(uninitialized::<$x>()));)+
$(let _ = $crate::_core::mem::transmute::<$x, $xs>;)+
}
};
($label:ident; $($xs:tt)+) => {
Expand Down

0 comments on commit d67cb97

Please sign in to comment.