Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE because uninhabited types and drop flags don't mix #17987

Closed
ben0x539 opened this Issue Oct 12, 2014 · 3 comments

Comments

Projects
None yet
4 participants
@ben0x539
Copy link
Contributor

ben0x539 commented Oct 12, 2014

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]. ;)

@kmcallister kmcallister added the I-ICE label Oct 13, 2014

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jan 16, 2015

This still ICEs for me today.

@tamird

This comment has been minimized.

Copy link
Contributor

tamird commented Apr 21, 2015

Still ICEs.

@steveklabnik steveklabnik referenced this issue Oct 23, 2015

Closed

Add ICEs to Glacier #29249

171 of 200 tasks complete

bltavares added a commit to bltavares/glacier that referenced this issue Oct 24, 2015

@bltavares bltavares referenced this issue Oct 24, 2015

Merged

17987 #31

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Mar 21, 2016

This no longer ICEs as of today's nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.