Skip to content

Commit 0718259

Browse files
committed
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.
1 parent d5b5aa4 commit 0718259

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/middle/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ fn any_tuple_struct_pat(bcx: &Block, m: &[Match], col: uint) -> bool {
11201120
m.iter().any(|br| {
11211121
let pat = *br.pats.get(col);
11221122
match pat.node {
1123-
ast::PatEnum(_, Some(_)) => {
1123+
ast::PatEnum(_, _) => {
11241124
match bcx.tcx().def_map.borrow().find(&pat.id) {
11251125
Some(&ast::DefFn(..)) |
11261126
Some(&ast::DefStruct(..)) => true,

0 commit comments

Comments
 (0)