diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2016-12-04 03:18:11 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2016-12-28 11:21:45 +0200 |
| commit | 6ebb6fdbee7f0d250e50e4d84d9aede293cf3bb3 (patch) | |
| tree | f40bc78586832c7af3feca2507fbc1a2b8b2316b /src/libsyntax | |
| parent | 0807104c8fa90b084748940f7a7980b5a765264e (diff) | |
| download | rust-6ebb6fdbee7f0d250e50e4d84d9aede293cf3bb3.tar.gz rust-6ebb6fdbee7f0d250e50e4d84d9aede293cf3bb3.zip | |
hir: lower `ImplicitSelf` to resolved `Self` TyQPath's.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 15 |
1 files changed, 7 insertions, 8 deletions
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, + })), } } } |
