@@ -291,6 +291,7 @@ pub fn variant_opt(bcx: block, pat_id: ast::node_id)
291
291
}
292
292
::core::util::unreachable();
293
293
}
294
+ ast::def_fn(*) |
294
295
ast::def_struct(_) => {
295
296
return lit(UnitLikeStructLit(pat_id));
296
297
}
@@ -818,6 +819,7 @@ pub fn get_options(bcx: block, m: &[@Match], col: uint) -> ~[Opt] {
818
819
// This could be one of: a tuple-like enum variant, a
819
820
// struct-like enum variant, or a struct.
820
821
match ccx.tcx.def_map.find(&cur.id) {
822
+ Some(&ast::def_fn(*)) |
821
823
Some(&ast::def_variant(*)) => {
822
824
add_to_set(ccx.tcx, &mut found,
823
825
variant_opt(bcx, cur.id));
@@ -1011,6 +1013,7 @@ pub fn any_tuple_struct_pat(bcx: block, m: &[@Match], col: uint) -> bool {
1011
1013
match pat.node {
1012
1014
ast::pat_enum(_, Some(_)) => {
1013
1015
match bcx.tcx().def_map.find(&pat.id) {
1016
+ Some(&ast::def_fn(*)) |
1014
1017
Some(&ast::def_struct(*)) => true,
1015
1018
_ => false
1016
1019
}
@@ -1780,6 +1783,7 @@ pub fn bind_irrefutable_pat(bcx: block,
1780
1783
}
1781
1784
}
1782
1785
}
1786
+ Some ( & ast:: def_fn ( * ) ) |
1783
1787
Some ( & ast:: def_struct ( * ) ) => {
1784
1788
match * sub_pats {
1785
1789
None => {
0 commit comments