You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enum Foo {}
impl Drop for Foo {
fn drop(&mut self) {}
}
fn main() {
unsafe { std::ptr::read(&1u8 as *const u8 as *const Foo) };
}
=> task 'rustc' failed at 'assertion failed: type_is_zero_size(bcx.ccx(), block_ty)'
Producing the value of the uninhabited type with transmute instead of ptr::read works "as expected". Another workaround is, of course, #![unsafe_no_drop_flag]. ;)