Skip to content

ICE while translating unsupported cast #17480

Closed
@ghost

Description

fn main() {
   enum Foo { F1 }
   let foo : *const Foo = F1 as *const Foo;
}
 $ rustc foo.rs 
foo.rs:4:9: 4:12 warning: unused variable: `foo`, #[warn(unused_variable)] on by default
foo.rs:4     let foo : *const Foo = F1 as *const Foo;
                 ^~~
error: internal compiler error: translating unsupported cast: main::Foo (cast_enum) -> *const main::Foo (cast_pointer)
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /var/tmp/portage/dev-lang/rust-9999-r2/work/rust-9999/src/libsyntax/diagnostic.rs:169

rust version: 1fb838d99

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

    Issue actions