rustc: Support irrefutable patterns in function arguments. r=nmatsakis

This commit is contained in:
Patrick Walton
2012-11-06 18:41:06 -08:00
parent b223c9c465
commit 0fc952372a
31 changed files with 392 additions and 159 deletions

View File

@@ -274,6 +274,12 @@ fn ident_to_path(s: span, +i: ident) -> @path {
rp: None, types: ~[]}
}
fn ident_to_pat(id: node_id, s: span, +i: ident) -> @pat {
@{id: id,
node: pat_ident(bind_by_value, ident_to_path(s, i), None),
span: s}
}
pure fn is_unguarded(a: &arm) -> bool {
match a.guard {
None => true,