Fix bug with * patterns in trans_alt
enter_opt was handling the (*) case wrong and causing a bounds check failure. Fixed it (the test case is one of the extracted ones from the reference manual)
This commit is contained in:
parent
55e29ef4aa
commit
7d05bea7b9
1 changed files with 2 additions and 1 deletions
|
@ -164,7 +164,8 @@ fn enter_opt(tcx: ty::ctxt, m: match, opt: opt, col: uint,
|
|||
alt p.node {
|
||||
ast::pat_enum(_, subpats) {
|
||||
if opt_eq(tcx, variant_opt(tcx, p.id), opt) {
|
||||
some(option::get_or_default(subpats, [])) }
|
||||
some(option::get_or_default(subpats,
|
||||
vec::from_elem(variant_size, dummy))) }
|
||||
else { none }
|
||||
}
|
||||
ast::pat_ident(_, none) if pat_is_variant(tcx.def_map, p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue