Skip to content

Commit

Permalink
transmute doesn’t need to be called to do its size check
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin authored Nov 8, 2017
1 parent 30f88bc commit c3e8447
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 c3e8447

Please sign in to comment.