Separate bindings from other patterns in HIR

This commit is contained in:
Vadim Petrochenkov 2016-03-06 15:54:44 +03:00
parent ab7c35fa0f
commit 216f5fba04
29 changed files with 230 additions and 300 deletions

View file

@ -2578,7 +2578,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::Binding(_, ref p, _) => p.node.to_string(),
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"),