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

syntax const_eval ICE #6047

Closed
jbclements opened this issue Apr 24, 2013 · 1 comment
Closed

syntax const_eval ICE #6047

jbclements opened this issue Apr 24, 2013 · 1 comment

Comments

@jbclements
Copy link
Contributor

Our current pattern syntax allows arbitrary expressions in some locations; these aren't checked properly, and result in ICEs in const_eval.rs.

to see this, compile this file:

fn f() -> int { 14 }

fn main() {
    match 15 {
        3 .. (f()) => io::println(~"success"),
        _ => fail!()
    }
}

this results in the output:

jclements-09740:/tmp clements> RUST_LOG=1 rustc /tmp/foo.rs
Running /usr/local/bin/rustc:
rust: task failed at 'Unsupported constant expr', /Users/clements/rust/src/librustc/middle/const_eval.rs:251
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/clements/rust/src/librustc/rustc.rc:356
rust: domain main @0x7fe78b819a10 root task failed

Honestly, the existing text ("unsupported constant expr") is pretty good here; if there's source information at this point, fixing this may simply be a question of turning fail! into self.fatal_error.

@Aatch
Copy link
Contributor

Aatch commented Jun 7, 2013

This no longer even parses: unexpected token: '('

@Aatch Aatch closed this as completed Jun 7, 2013
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