diff options
| author | Kevin Ballard <kevin@sb.org> | 2014-05-20 19:18:20 -0700 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2014-05-20 19:52:43 -0700 |
| commit | 0718259ae05e661c7f62bac6a02c6cba80d3f1f9 (patch) | |
| tree | 0abcd808933067e0cfe4c70aff09a1959578017c | |
| parent | d5b5aa4d4a11a15bab4dbb31e029a807cb1d4ad3 (diff) | |
| download | rust-0718259ae05e661c7f62bac6a02c6cba80d3f1f9.tar.gz rust-0718259ae05e661c7f62bac6a02c6cba80d3f1f9.zip | |
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.
| -rw-r--r-- | src/librustc/middle/trans/_match.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index d9eec2056d8..4a96439e0ec 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -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, |
