Don't refute "()" in let-bindings (fixes #3104).
This commit is contained in:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user