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:
parent
d5b5aa4d4a
commit
0718259ae0
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user