-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
Compiling this small snippet
enum Expression {
Symbol(~str),
Compound(~str, ~[Expression])
}
fn standard_form(expr: &Expression) -> ~str {
match (*expr) {
Compound(~"List", ref items) => ~"list",
Compound(~"Blank", []) => ~"_",
_ => ~"default"
}
}
fn main() {
let x = ~Symbol(~"x");
println(standard_form(x));
}
yields the following error
error: internal compiler error: sequence_element_type called on non-sequence value
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
task 'rustc' failed at 'explicit failure', /var/tmp/portage/dev-lang/rust-9999/work/rust-9999/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /var/tmp/portage/dev-lang/rust-9999/work/rust-9999/src/librustc/lib.rs:394
Swapping the order of the List and Blank cases makes the error go away. This might be a duplicate of Issue #7990, but the code there that elicits this is so different I thought it'd be worthwhile to open a whole new issue.
Metadata
Metadata
Assignees
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️