diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-02-17 19:29:13 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-02-24 14:16:02 +0200 |
| commit | d31b9ebef5c39de3fff9da02eea880d1838a8a3b (patch) | |
| tree | 320decdd7d81877f5db694e6bc6baa322f6487ce /src/libsyntax/visit.rs | |
| parent | fdfb532d7829d6e5637ddffa6faff69e4312b0e0 (diff) | |
| download | rust-d31b9ebef5c39de3fff9da02eea880d1838a8a3b.tar.gz rust-d31b9ebef5c39de3fff9da02eea880d1838a8a3b.zip | |
Implement `<T>::method` UFCS expression syntax.
Diffstat (limited to 'src/libsyntax/visit.rs')
| -rw-r--r-- | src/libsyntax/visit.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 55372585062..33d8d56b4b1 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -396,13 +396,12 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) { walk_fn_ret_ty(visitor, &function_declaration.decl.output); walk_lifetime_decls_helper(visitor, &function_declaration.lifetimes); } - TyPath(ref path) => { + TyPath(ref maybe_qself, ref path) => { + if let Some(ref qself) = *maybe_qself { + visitor.visit_ty(&qself.ty); + } visitor.visit_path(path, typ.id); } - TyQPath(ref qpath) => { - visitor.visit_ty(&*qpath.self_type); - visitor.visit_path(&qpath.path, typ.id); - } TyObjectSum(ref ty, ref bounds) => { visitor.visit_ty(&**ty); walk_ty_param_bounds_helper(visitor, bounds); @@ -859,13 +858,12 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) { walk_expr_opt(visitor, start); walk_expr_opt(visitor, end) } - ExprPath(ref path) => { + ExprPath(ref maybe_qself, ref path) => { + if let Some(ref qself) = *maybe_qself { + visitor.visit_ty(&qself.ty); + } visitor.visit_path(path, expression.id) } - ExprQPath(ref qpath) => { - visitor.visit_ty(&*qpath.self_type); - visitor.visit_path(&qpath.path, expression.id); - } ExprBreak(_) | ExprAgain(_) => {} ExprRet(ref optional_expression) => { walk_expr_opt(visitor, optional_expression) |
