Skip to content

invalid dereference on enum leads to compiler internal error #2073

Closed
@grahame

Description

@grahame

Compiling the following incorrect program

enum blah {
    field1
}
fn main(args: [str]) {
    let a : int = *field1;
}

with rust 0d5d2e5 fails:

test.rs:5:18: 5:25 error: can only dereference enums with a single variant which has a single argument
test.rs:5     let a : int = *field1;
                            ^~~~~~~
rust: upcall fail 'bounds check', ../src/rustc/middle/typeck.rs:2705
error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: upcall fail 'explicit failure', ../src/rustc/driver/rustc.rs:182
rust: domain main @0x7ffa93819a00 root task failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions