Split PatKind::Enum into PatKind::TupleStruct and PatKind::Path

This commit is contained in:
Vadim Petrochenkov 2016-02-16 00:40:38 +03:00
parent 9b40e1e5b3
commit 06755d90ce
22 changed files with 137 additions and 142 deletions

View file

@ -2554,7 +2554,7 @@ fn name_from_pat(p: &hir::Pat) -> String {
match p.node {
PatKind::Wild => "_".to_string(),
PatKind::Ident(_, ref p, _) => p.node.to_string(),
PatKind::Enum(ref p, _) => path_to_string(p),
PatKind::TupleStruct(ref p, _) | PatKind::Path(ref p) => path_to_string(p),
PatKind::QPath(..) => panic!("tried to get argument name from PatKind::QPath, \
which is not allowed in function arguments"),
PatKind::Struct(ref name, ref fields, etc) => {