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 with C generic enum #33202

Closed
pravic opened this issue Apr 25, 2016 · 2 comments
Closed

ICE with C generic enum #33202

pravic opened this issue Apr 25, 2016 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@pravic
Copy link
Contributor

pravic commented Apr 25, 2016

http://is.gd/DOkUCJ Playground with backtrace

#[repr(C)]
pub enum CPOption<T> {
    PSome(T),
}

fn main() {
  println!("sizeof CPOption<i32> {}", std::mem::size_of::<CPOption<i32>>());
}

Versions affected: stable, beta, nightly.

@MagaTailor
Copy link

Here's a debug trace from rustc 1.9.0-dev (470ca1c3f 2016-04-07)

@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 26, 2016
@luqmana
Copy link
Member

luqmana commented Apr 28, 2016

This is not limited to generic enums. Just an oversight in typeck that we allow it to get to trans at all.

bors added a commit that referenced this issue May 13, 2016
adt: Allow repr attribute on single variant enum.

Fixes #33202.
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