Closed
Description
This code causes an ICE in trans::alt::compile_submatch
(where it calls option::get
):
enum pat { pat_ident(option<uint>) }
fn f(pat: pat) -> bool { true }
fn num_bindings(pat: pat) -> uint {
alt pat {
pat_ident(_) if f(pat) { 0 }
pat_ident(none) { 1 }
pat_ident(some(sub)) { sub }
}
}
fn main() {}
I've tried to fix it, but I just don't understand the code that compiles pattern matches. Comments would be helpful.