1
Fork 0

Don't refute "()" in let-bindings (fixes #3104).

This commit is contained in:
Ben Blum 2012-08-21 21:03:47 -04:00
parent 8694ef6fb3
commit 9b489f6fff
2 changed files with 4 additions and 0 deletions

View file

@ -420,6 +420,7 @@ fn is_refutable(tcx: ty::ctxt, pat: @pat) -> bool {
is_refutable(tcx, sub)
}
pat_wild | pat_ident(_, _, none) => { false }
pat_lit(@{node: expr_lit(@{node: lit_nil, _}), _}) => { false } // "()"
pat_lit(_) | pat_range(_, _) => { true }
pat_rec(fields, _) => {
for fields.each |it| {

View file

@ -0,0 +1,3 @@
fn main() {
let ((),()) = ((),());
}