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
Closed

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

ben0x539 opened this issue Oct 12, 2014 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ben0x539
Copy link
Contributor

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 Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 13, 2014
@steveklabnik
Copy link
Member

This still ICEs for me today.

@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

Still ICEs.

@steveklabnik
Copy link
Member

This no longer ICEs as of today's nightly.

lnicola pushed a commit to lnicola/rust that referenced this issue Aug 29, 2024
fix: Fix name resolution of shadowed builtin macro

Fixes rust-lang#17969.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants