Skip to content

invalid dereference on enum leads to compiler internal error #2073

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

Closed
grahame opened this issue Mar 29, 2012 · 0 comments
Closed

invalid dereference on enum leads to compiler internal error #2073

grahame opened this issue Mar 29, 2012 · 0 comments

Comments

@grahame
Copy link
Contributor

grahame commented Mar 29, 2012

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
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants