-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Closed
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
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]. ;)
Metadata
Metadata
Assignees
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️