Fix LLVM error with tuple struct match using (..)

Consider PatEnums constructed with A(..) to be candidates for tuple
struct patterns, not just ones constructed with A(a,b,c). If these
patterns shouldn't be valid tuple struct patterns (as they're equivalent
to _), this needs to be caught before we get to trans.

Fixes #14308.
This commit is contained in:
Kevin Ballard 2014-05-20 19:18:20 -07:00
parent d5b5aa4d4a
commit 0718259ae0
1 changed files with 1 additions and 1 deletions

View File

@ -1120,7 +1120,7 @@ fn any_tuple_struct_pat(bcx: &Block, m: &[Match], col: uint) -> bool {
m.iter().any(|br| {
let pat = *br.pats.get(col);
match pat.node {
ast::PatEnum(_, Some(_)) => {
ast::PatEnum(_, _) => {
match bcx.tcx().def_map.borrow().find(&pat.id) {
Some(&ast::DefFn(..)) |
Some(&ast::DefStruct(..)) => true,