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]. ;)
The text was updated successfully, but these errors were encountered:
kmcallister
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Oct 13, 2014
=>
task 'rustc' failed at 'assertion failed: type_is_zero_size(bcx.ccx(), block_ty)'
Producing the value of the uninhabited type with
transmute
instead ofptr::read
works "as expected". Another workaround is, of course,#![unsafe_no_drop_flag]
. ;)The text was updated successfully, but these errors were encountered: