From 0718259ae05e661c7f62bac6a02c6cba80d3f1f9 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Tue, 20 May 2014 19:18:20 -0700 Subject: [PATCH] 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. --- src/librustc/middle/trans/_match.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index d9eec2056d88..4a96439e0ec5 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,