Skip to content

ICE with C generic enum #33202

Closed
Closed
@pravic

Description

@pravic
Contributor

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.

Activity

MagaTailor

MagaTailor commented on Apr 25, 2016

@MagaTailor

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

added
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Apr 26, 2016
luqmana

luqmana commented on Apr 28, 2016

@luqmana
Member

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

added a commit that references this issue on May 13, 2016

Auto merge of #33355 - luqmana:33202-repr-ice, r=nrc

33a5c9d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sanxiyn@luqmana@pravic@MagaTailor

        Issue actions

          ICE with C generic enum · Issue #33202 · rust-lang/rust