From 6ebb6fdbee7f0d250e50e4d84d9aede293cf3bb3 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Sun, 4 Dec 2016 03:18:11 +0200 Subject: hir: lower `ImplicitSelf` to resolved `Self` TyQPath's. --- src/libsyntax/ast.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index a5abdd922d6..f72985fd91a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1471,12 +1471,13 @@ impl Arg { } pub fn from_self(eself: ExplicitSelf, eself_ident: SpannedIdent) -> Arg { + let span = mk_sp(eself.span.lo, eself_ident.span.hi); let infer_ty = P(Ty { id: DUMMY_NODE_ID, node: TyKind::ImplicitSelf, - span: DUMMY_SP, + span: span, }); - let arg = |mutbl, ty, span| Arg { + let arg = |mutbl, ty| Arg { pat: P(Pat { id: DUMMY_NODE_ID, node: PatKind::Ident(BindingMode::ByValue(mutbl), eself_ident, None), @@ -1486,15 +1487,13 @@ impl Arg { id: DUMMY_NODE_ID, }; match eself.node { - SelfKind::Explicit(ty, mutbl) => { - arg(mutbl, ty, mk_sp(eself.span.lo, eself_ident.span.hi)) - } - SelfKind::Value(mutbl) => arg(mutbl, infer_ty, eself.span), + SelfKind::Explicit(ty, mutbl) => arg(mutbl, ty), + SelfKind::Value(mutbl) => arg(mutbl, infer_ty), SelfKind::Region(lt, mutbl) => arg(Mutability::Immutable, P(Ty { id: DUMMY_NODE_ID, node: TyKind::Rptr(lt, MutTy { ty: infer_ty, mutbl: mutbl }), - span: DUMMY_SP, - }), eself.span), + span: span, + })), } } } -- cgit 1.4.1-3-g733a5