about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-04-30 08:49:48 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-05-14 20:10:46 -0700
commit18f6a51d0ae87fbd4b8e62c567d121aa065dc4d3 (patch)
tree9b9f81aae4161723d2a619171ff8c75345ca9f40 /src/libsyntax
parent70e02cf4457e4c354c74da3c2121f1e373ad7f63 (diff)
downloadrust-18f6a51d0ae87fbd4b8e62c567d121aa065dc4d3.tar.gz
rust-18f6a51d0ae87fbd4b8e62c567d121aa065dc4d3.zip
rustc: rename ast::self_ty and related fields to explicit_self
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs12
-rw-r--r--src/libsyntax/ast_util.rs2
-rw-r--r--src/libsyntax/ext/auto_encode.rs4
-rw-r--r--src/libsyntax/ext/deriving/clone.rs2
-rw-r--r--src/libsyntax/ext/deriving/cmp/eq.rs2
-rw-r--r--src/libsyntax/ext/deriving/cmp/ord.rs2
-rw-r--r--src/libsyntax/ext/deriving/cmp/totaleq.rs2
-rw-r--r--src/libsyntax/ext/deriving/cmp/totalord.rs2
-rw-r--r--src/libsyntax/ext/deriving/decodable.rs4
-rw-r--r--src/libsyntax/ext/deriving/encodable.rs4
-rw-r--r--src/libsyntax/ext/deriving/generic.rs33
-rw-r--r--src/libsyntax/ext/deriving/iter_bytes.rs2
-rw-r--r--src/libsyntax/ext/deriving/rand.rs2
-rw-r--r--src/libsyntax/ext/deriving/to_str.rs2
-rw-r--r--src/libsyntax/ext/deriving/ty.rs2
-rw-r--r--src/libsyntax/fold.rs2
-rw-r--r--src/libsyntax/parse/parser.rs36
-rw-r--r--src/libsyntax/print/pprust.rs40
18 files changed, 77 insertions, 78 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 4ef38c300c6..b508ae48c36 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -767,7 +767,7 @@ pub struct ty_method {
     purity: purity,
     decl: fn_decl,
     generics: Generics,
-    self_ty: self_ty,
+    explicit_self: explicit_self,
     id: node_id,
     span: span,
 }
@@ -1064,7 +1064,7 @@ impl to_bytes::IterBytes for ret_style {
 #[auto_encode]
 #[auto_decode]
 #[deriving(Eq)]
-pub enum self_ty_ {
+pub enum explicit_self_ {
     sty_static,                                // no self
     sty_value,                                 // `self`
     sty_region(Option<@Lifetime>, mutability), // `&'lt self`
@@ -1073,7 +1073,7 @@ pub enum self_ty_ {
 }
 
 #[cfg(stage0)]
-impl to_bytes::IterBytes for self_ty_ {
+impl to_bytes::IterBytes for explicit_self_ {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
         match *self {
             sty_static => 0u8.iter_bytes(lsb0, f),
@@ -1086,7 +1086,7 @@ impl to_bytes::IterBytes for self_ty_ {
 }
 
 #[cfg(not(stage0))]
-impl to_bytes::IterBytes for self_ty_ {
+impl to_bytes::IterBytes for explicit_self_ {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         match *self {
             sty_static => 0u8.iter_bytes(lsb0, f),
@@ -1098,7 +1098,7 @@ impl to_bytes::IterBytes for self_ty_ {
     }
 }
 
-pub type self_ty = spanned<self_ty_>;
+pub type explicit_self = spanned<explicit_self_>;
 
 #[auto_encode]
 #[auto_decode]
@@ -1107,7 +1107,7 @@ pub struct method {
     ident: ident,
     attrs: ~[attribute],
     generics: Generics,
-    self_ty: self_ty,
+    explicit_self: explicit_self,
     purity: purity,
     decl: fn_decl,
     body: blk,
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index 212ceadf912..a98e3002dcf 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -272,7 +272,7 @@ pub fn trait_method_to_ty_method(method: &trait_method) -> ty_method {
                 purity: m.purity,
                 decl: copy m.decl,
                 generics: copy m.generics,
-                self_ty: m.self_ty,
+                explicit_self: m.explicit_self,
                 id: m.id,
                 span: m.span,
             }
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs
index ac86d266d73..fa9d69c6e99 100644
--- a/src/libsyntax/ext/auto_encode.rs
+++ b/src/libsyntax/ext/auto_encode.rs
@@ -713,7 +713,7 @@ fn mk_ser_method(
         ident: cx.ident_of("encode"),
         attrs: ~[],
         generics: ast_util::empty_generics(),
-        self_ty: codemap::spanned {
+        explicit_self: codemap::spanned {
             node: ast::sty_region(None, ast::m_imm),
             span: span
         },
@@ -772,7 +772,7 @@ fn mk_deser_method(
         ident: cx.ident_of("decode"),
         attrs: ~[],
         generics: ast_util::empty_generics(),
-        self_ty: codemap::spanned { node: ast::sty_static, span: span },
+        explicit_self: codemap::spanned { node: ast::sty_static, span: span },
         purity: ast::impure_fn,
         decl: deser_decl,
         body: deser_body,
diff --git a/src/libsyntax/ext/deriving/clone.rs b/src/libsyntax/ext/deriving/clone.rs
index 2151e9529c4..1a45107c267 100644
--- a/src/libsyntax/ext/deriving/clone.rs
+++ b/src/libsyntax/ext/deriving/clone.rs
@@ -28,7 +28,7 @@ pub fn expand_deriving_clone(cx: @ext_ctxt,
             MethodDef {
                 name: ~"clone",
                 generics: LifetimeBounds::empty(),
-                self_ty: borrowed_explicit_self(),
+                explicit_self: borrowed_explicit_self(),
                 args: ~[],
                 ret_ty: Self,
                 const_nonmatching: false,
diff --git a/src/libsyntax/ext/deriving/cmp/eq.rs b/src/libsyntax/ext/deriving/cmp/eq.rs
index e431e1f78bf..7fc2fdc7963 100644
--- a/src/libsyntax/ext/deriving/cmp/eq.rs
+++ b/src/libsyntax/ext/deriving/cmp/eq.rs
@@ -34,7 +34,7 @@ pub fn expand_deriving_eq(cx: @ext_ctxt,
             MethodDef {
                 name: $name,
                 generics: LifetimeBounds::empty(),
-                self_ty: borrowed_explicit_self(),
+                explicit_self: borrowed_explicit_self(),
                 args: ~[borrowed_self()],
                 ret_ty: Literal(Path::new(~[~"bool"])),
                 const_nonmatching: true,
diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs
index cdb9f620301..5445aef4491 100644
--- a/src/libsyntax/ext/deriving/cmp/ord.rs
+++ b/src/libsyntax/ext/deriving/cmp/ord.rs
@@ -24,7 +24,7 @@ pub fn expand_deriving_ord(cx: @ext_ctxt,
             MethodDef {
                 name: $name,
                 generics: LifetimeBounds::empty(),
-                self_ty: borrowed_explicit_self(),
+                explicit_self: borrowed_explicit_self(),
                 args: ~[borrowed_self()],
                 ret_ty: Literal(Path::new(~[~"bool"])),
                 const_nonmatching: false,
diff --git a/src/libsyntax/ext/deriving/cmp/totaleq.rs b/src/libsyntax/ext/deriving/cmp/totaleq.rs
index 068a7bc06b1..4541569b829 100644
--- a/src/libsyntax/ext/deriving/cmp/totaleq.rs
+++ b/src/libsyntax/ext/deriving/cmp/totaleq.rs
@@ -33,7 +33,7 @@ pub fn expand_deriving_totaleq(cx: @ext_ctxt,
             MethodDef {
                 name: ~"equals",
                 generics: LifetimeBounds::empty(),
-                self_ty: borrowed_explicit_self(),
+                explicit_self: borrowed_explicit_self(),
                 args: ~[borrowed_self()],
                 ret_ty: Literal(Path::new(~[~"bool"])),
                 const_nonmatching: true,
diff --git a/src/libsyntax/ext/deriving/cmp/totalord.rs b/src/libsyntax/ext/deriving/cmp/totalord.rs
index 5ec4e028454..8f156e6a9e3 100644
--- a/src/libsyntax/ext/deriving/cmp/totalord.rs
+++ b/src/libsyntax/ext/deriving/cmp/totalord.rs
@@ -27,7 +27,7 @@ pub fn expand_deriving_totalord(cx: @ext_ctxt,
             MethodDef {
                 name: ~"cmp",
                 generics: LifetimeBounds::empty(),
-                self_ty: borrowed_explicit_self(),
+                explicit_self: borrowed_explicit_self(),
                 args: ~[borrowed_self()],
                 ret_ty: Literal(Path::new(~[~"core", ~"cmp", ~"Ordering"])),
                 const_nonmatching: false,
diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs
index fd5d26a1787..3be65ecd8db 100644
--- a/src/libsyntax/ext/deriving/decodable.rs
+++ b/src/libsyntax/ext/deriving/decodable.rs
@@ -119,13 +119,13 @@ fn create_decode_method(
     let body_block = build::mk_simple_block(cx, span, expr);
 
     // Create the method.
-    let self_ty = spanned { node: sty_static, span: span };
+    let explicit_self = spanned { node: sty_static, span: span };
     let method_ident = cx.ident_of("decode");
     @ast::method {
         ident: method_ident,
         attrs: ~[],
         generics: ast_util::empty_generics(),
-        self_ty: self_ty,
+        explicit_self: explicit_self,
         purity: impure_fn,
         decl: fn_decl,
         body: body_block,
diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs
index a5edd92022f..2078ec9d45c 100644
--- a/src/libsyntax/ext/deriving/encodable.rs
+++ b/src/libsyntax/ext/deriving/encodable.rs
@@ -111,13 +111,13 @@ fn create_encode_method(
     let body_block = build::mk_block_(cx, span, statements);
 
     // Create the method.
-    let self_ty = spanned { node: sty_region(None, m_imm), span: span };
+    let explicit_self = spanned { node: sty_region(None, m_imm), span: span };
     let method_ident = cx.ident_of("encode");
     @ast::method {
         ident: method_ident,
         attrs: ~[],
         generics: ast_util::empty_generics(),
-        self_ty: self_ty,
+        explicit_self: explicit_self,
         purity: impure_fn,
         decl: fn_decl,
         body: body_block,
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index be2cc6dd25e..fc14e3c3f73 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -216,7 +216,7 @@ pub struct MethodDef<'self> {
     /// Whether there is a self argument (outer Option) i.e. whether
     /// this is a static function, and whether it is a pointer (inner
     /// Option)
-    self_ty: Option<Option<PtrTy>>,
+    explicit_self: Option<Option<PtrTy>>,
 
     /// Arguments other than the self argument
     args: ~[Ty],
@@ -321,7 +321,7 @@ impl<'self> TraitDef<'self> {
                          type_ident: ident,
                          generics: &Generics) -> @ast::item {
         let methods = do self.methods.map |method_def| {
-            let (self_ty, self_args, nonself_args, tys) =
+            let (explicit_self, self_args, nonself_args, tys) =
                 method_def.split_self_nonself_args(cx, span, type_ident, generics);
 
             let body = if method_def.is_static() {
@@ -339,7 +339,7 @@ impl<'self> TraitDef<'self> {
 
             method_def.create_method(cx, span,
                                      type_ident, generics,
-                                     self_ty, tys,
+                                     explicit_self, tys,
                                      body)
         };
 
@@ -352,7 +352,7 @@ impl<'self> TraitDef<'self> {
                        type_ident: ident,
                        generics: &Generics) -> @ast::item {
         let methods = do self.methods.map |method_def| {
-            let (self_ty, self_args, nonself_args, tys) =
+            let (explicit_self, self_args, nonself_args, tys) =
                 method_def.split_self_nonself_args(cx, span, type_ident, generics);
 
             let body = if method_def.is_static() {
@@ -370,7 +370,7 @@ impl<'self> TraitDef<'self> {
 
             method_def.create_method(cx, span,
                                      type_ident, generics,
-                                     self_ty, tys,
+                                     explicit_self, tys,
                                      body)
         };
 
@@ -404,28 +404,27 @@ impl<'self> MethodDef<'self> {
     }
 
     fn is_static(&self) -> bool {
-        self.self_ty.is_none()
+        self.explicit_self.is_none()
     }
 
     fn split_self_nonself_args(&self, cx: @ext_ctxt, span: span,
                              type_ident: ident, generics: &Generics)
-        -> (ast::self_ty, ~[@expr], ~[@expr], ~[(ident, @ast::Ty)]) {
+        -> (ast::explicit_self, ~[@expr], ~[@expr], ~[(ident, @ast::Ty)]) {
 
         let mut self_args = ~[], nonself_args = ~[], arg_tys = ~[];
-        let mut ast_self_ty = respan(span, ast::sty_static);
         let mut nonstatic = false;
 
-        match self.self_ty {
+        let ast_explicit_self = match self.explicit_self {
             Some(ref self_ptr) => {
-                let (self_expr, self_ty) = ty::get_explicit_self(cx, span,
-                                                                 self_ptr);
+                let (self_expr, explicit_self) = ty::get_explicit_self(cx, span, self_ptr);
 
-                ast_self_ty = self_ty;
                 self_args.push(self_expr);
                 nonstatic = true;
+
+                explicit_self
             }
-            _ => {}
-        }
+            None => respan(span, ast::sty_static),
+        };
 
         for self.args.eachi |i, ty| {
             let ast_ty = ty.to_ty(cx, span, type_ident, generics);
@@ -449,13 +448,13 @@ impl<'self> MethodDef<'self> {
             }
         }
 
-        (ast_self_ty, self_args, nonself_args, arg_tys)
+        (ast_explicit_self, self_args, nonself_args, arg_tys)
     }
 
     fn create_method(&self, cx: @ext_ctxt, span: span,
                      type_ident: ident,
                      generics: &Generics,
-                     self_ty: ast::self_ty,
+                     explicit_self: ast::explicit_self,
                      arg_types: ~[(ident, @ast::Ty)],
                      body: @expr) -> @ast::method {
         // create the generics that aren't for Self
@@ -477,7 +476,7 @@ impl<'self> MethodDef<'self> {
             ident: method_ident,
             attrs: ~[],
             generics: fn_generics,
-            self_ty: self_ty,
+            explicit_self: explicit_self,
             purity: ast::impure_fn,
             decl: fn_decl,
             body: body_block,
diff --git a/src/libsyntax/ext/deriving/iter_bytes.rs b/src/libsyntax/ext/deriving/iter_bytes.rs
index 9eb246ffe22..27e3a54add5 100644
--- a/src/libsyntax/ext/deriving/iter_bytes.rs
+++ b/src/libsyntax/ext/deriving/iter_bytes.rs
@@ -26,7 +26,7 @@ pub fn expand_deriving_iter_bytes(cx: @ext_ctxt,
             MethodDef {
                 name: ~"iter_bytes",
                 generics: LifetimeBounds::empty(),
-                self_ty: borrowed_explicit_self(),
+                explicit_self: borrowed_explicit_self(),
                 args: ~[
                     Literal(Path::new(~[~"bool"])),
                     Literal(Path::new(~[~"core", ~"to_bytes", ~"Cb"]))
diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs
index 9030be86f39..2d91fcd346a 100644
--- a/src/libsyntax/ext/deriving/rand.rs
+++ b/src/libsyntax/ext/deriving/rand.rs
@@ -32,7 +32,7 @@ pub fn expand_deriving_rand(cx: @ext_ctxt,
                     bounds: ~[(~"R",
                                ~[ Path::new(~[~"core", ~"rand", ~"Rng"]) ])]
                 },
-                self_ty: None,
+                explicit_self: None,
                 args: ~[
                     Ptr(~Literal(Path::new_local(~"R")),
                         Borrowed(None, ast::m_mutbl))
diff --git a/src/libsyntax/ext/deriving/to_str.rs b/src/libsyntax/ext/deriving/to_str.rs
index 6010354349e..13cb09e970d 100644
--- a/src/libsyntax/ext/deriving/to_str.rs
+++ b/src/libsyntax/ext/deriving/to_str.rs
@@ -27,7 +27,7 @@ pub fn expand_deriving_to_str(cx: @ext_ctxt,
             MethodDef {
                 name: ~"to_str",
                 generics: LifetimeBounds::empty(),
-                self_ty: borrowed_explicit_self(),
+                explicit_self: borrowed_explicit_self(),
                 args: ~[],
                 ret_ty: Ptr(~Literal(Path::new_local(~"str")), Owned),
                 const_nonmatching: false,
diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs
index 768ac7458d6..8fd372e4792 100644
--- a/src/libsyntax/ext/deriving/ty.rs
+++ b/src/libsyntax/ext/deriving/ty.rs
@@ -217,7 +217,7 @@ pub impl LifetimeBounds {
 
 
 pub fn get_explicit_self(cx: @ext_ctxt, span: span, self_ptr: &Option<PtrTy>)
-    -> (@expr, ast::self_ty) {
+    -> (@expr, ast::explicit_self) {
     let self_path = build::make_self(cx, span);
     match *self_ptr {
         None => {
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index 6ed8994ed33..f6dbbbf420d 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -323,7 +323,7 @@ fn noop_fold_method(m: @method, fld: @ast_fold) -> @method {
         ident: fld.fold_ident(m.ident),
         attrs: /* FIXME (#2543) */ copy m.attrs,
         generics: fold_generics(&m.generics, fld),
-        self_ty: m.self_ty,
+        explicit_self: m.explicit_self,
         purity: m.purity,
         decl: fold_fn_decl(&m.decl, fld),
         body: fld.fold_block(&m.body),
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index e1fe20695c7..b1fa47f6917 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -19,7 +19,7 @@ use ast::{_mod, add, arg, arm, attribute, bind_by_ref, bind_infer};
 use ast::{bind_by_copy, bitand, bitor, bitxor, blk};
 use ast::{blk_check_mode, box};
 use ast::{crate, crate_cfg, decl, decl_item};
-use ast::{decl_local, default_blk, deref, div, enum_def};
+use ast::{decl_local, default_blk, deref, div, enum_def, explicit_self};
 use ast::{expr, expr_, expr_addr_of, expr_match, expr_again};
 use ast::{expr_assign, expr_assign_op, expr_binary, expr_block};
 use ast::{expr_break, expr_call, expr_cast, expr_copy, expr_do_body};
@@ -43,7 +43,7 @@ use ast::{named_field, neg, node_id, noreturn, not, pat, pat_box, pat_enum};
 use ast::{pat_ident, pat_lit, pat_range, pat_region, pat_struct};
 use ast::{pat_tup, pat_uniq, pat_wild, private};
 use ast::{rem, required};
-use ast::{ret_style, return_val, self_ty, shl, shr, stmt, stmt_decl};
+use ast::{ret_style, return_val, shl, shr, stmt, stmt_decl};
 use ast::{stmt_expr, stmt_semi, stmt_mac, struct_def, struct_field};
 use ast::{struct_variant_kind, subtract};
 use ast::{sty_box, sty_region, sty_static, sty_uniq, sty_value};
@@ -504,7 +504,7 @@ pub impl Parser {
 
             let generics = p.parse_generics();
 
-            let (self_ty, d) = do self.parse_fn_decl_with_self() |p| {
+            let (explicit_self, d) = do self.parse_fn_decl_with_self() |p| {
                 // This is somewhat dubious; We don't want to allow argument
                 // names to be left off if there is a definition...
                 either::Left(p.parse_arg_general(false))
@@ -526,7 +526,7 @@ pub impl Parser {
                     purity: pur,
                     decl: d,
                     generics: generics,
-                    self_ty: self_ty,
+                    explicit_self: explicit_self,
                     id: p.get_id(),
                     span: mk_sp(lo, hi)
                 })
@@ -540,7 +540,7 @@ pub impl Parser {
                     ident: ident,
                     attrs: attrs,
                     generics: generics,
-                    self_ty: self_ty,
+                    explicit_self: explicit_self,
                     purity: pur,
                     decl: d,
                     body: body,
@@ -3002,11 +3002,11 @@ pub impl Parser {
         &self,
         parse_arg_fn:
         &fn(&Parser) -> arg_or_capture_item
-    ) -> (self_ty, fn_decl) {
-        fn maybe_parse_self_ty(
-            cnstr: &fn(v: mutability) -> ast::self_ty_,
+    ) -> (explicit_self, fn_decl) {
+        fn maybe_parse_explicit_self(
+            cnstr: &fn(v: mutability) -> ast::explicit_self_,
             p: &Parser
-        ) -> ast::self_ty_ {
+        ) -> ast::explicit_self_ {
             // We need to make sure it isn't a mode or a type
             if p.token_is_keyword(&~"self", &p.look_ahead(1)) ||
                 ((p.token_is_keyword(&~"const", &p.look_ahead(1)) ||
@@ -3022,7 +3022,7 @@ pub impl Parser {
             }
         }
 
-        fn maybe_parse_borrowed_self_ty(this: &Parser) -> ast::self_ty_ {
+        fn maybe_parse_borrowed_explicit_self(this: &Parser) -> ast::explicit_self_ {
             // The following things are possible to see here:
             //
             //     fn(&self)
@@ -3066,15 +3066,15 @@ pub impl Parser {
         // A bit of complexity and lookahead is needed here in order to to be
         // backwards compatible.
         let lo = self.span.lo;
-        let self_ty = match *self.token {
+        let explicit_self = match *self.token {
           token::BINOP(token::AND) => {
-            maybe_parse_borrowed_self_ty(self)
+            maybe_parse_borrowed_explicit_self(self)
           }
           token::AT => {
-            maybe_parse_self_ty(sty_box, self)
+            maybe_parse_explicit_self(sty_box, self)
           }
           token::TILDE => {
-            maybe_parse_self_ty(sty_uniq, self)
+            maybe_parse_explicit_self(sty_uniq, self)
           }
           token::IDENT(*) if self.is_self_ident() => {
             self.bump();
@@ -3087,7 +3087,7 @@ pub impl Parser {
 
         // If we parsed a self type, expect a comma before the argument list.
         let args_or_capture_items;
-        if self_ty != sty_static {
+        if explicit_self != sty_static {
             match *self.token {
                 token::COMMA => {
                     self.bump();
@@ -3132,7 +3132,7 @@ pub impl Parser {
             cf: ret_style
         };
 
-        (spanned(lo, hi, self_ty), fn_decl)
+        (spanned(lo, hi, explicit_self), fn_decl)
     }
 
     // parse the |arg, arg| header on a lambda
@@ -3199,7 +3199,7 @@ pub impl Parser {
         let pur = self.parse_fn_purity();
         let ident = self.parse_ident();
         let generics = self.parse_generics();
-        let (self_ty, decl) = do self.parse_fn_decl_with_self() |p| {
+        let (explicit_self, decl) = do self.parse_fn_decl_with_self() |p| {
             p.parse_arg()
         };
 
@@ -3210,7 +3210,7 @@ pub impl Parser {
             ident: ident,
             attrs: attrs,
             generics: generics,
-            self_ty: self_ty,
+            explicit_self: explicit_self,
             purity: pur,
             decl: decl,
             body: body,
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 1e94c16f87a..49a30d153dc 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -181,12 +181,12 @@ pub fn path_to_str(p: @ast::Path, intr: @ident_interner) -> ~str {
 }
 
 pub fn fun_to_str(decl: &ast::fn_decl, purity: ast::purity, name: ast::ident,
-                  opt_self_ty: Option<ast::self_ty_>,
+                  opt_explicit_self: Option<ast::explicit_self_>,
                   generics: &ast::Generics, intr: @ident_interner) -> ~str {
     do io::with_str_writer |wr| {
         let s = rust_printer(wr, intr);
         print_fn(s, decl, Some(purity), AbiSet::Rust(),
-                 name, generics, opt_self_ty, ast::inherited);
+                 name, generics, opt_explicit_self, ast::inherited);
         end(s); // Close the head box
         end(s); // Close the outer box
         eof(s.s);
@@ -797,7 +797,7 @@ pub fn print_ty_method(s: @ps, m: &ast::ty_method) {
     print_outer_attributes(s, m.attrs);
     print_ty_fn(s, None, None, None, m.purity, ast::Many,
                 &m.decl, Some(m.ident), Some(&m.generics),
-                Some(/*bad*/ copy m.self_ty.node));
+                Some(/*bad*/ copy m.explicit_self.node));
     word(s.s, ~";");
 }
 
@@ -813,7 +813,7 @@ pub fn print_method(s: @ps, meth: @ast::method) {
     maybe_print_comment(s, meth.span.lo);
     print_outer_attributes(s, meth.attrs);
     print_fn(s, &meth.decl, Some(meth.purity), AbiSet::Rust(),
-             meth.ident, &meth.generics, Some(meth.self_ty.node),
+             meth.ident, &meth.generics, Some(meth.explicit_self.node),
              meth.vis);
     word(s.s, ~" ");
     print_block_with_attrs(s, &meth.body, meth.attrs);
@@ -1626,13 +1626,13 @@ pub fn print_pat(s: @ps, pat: @ast::pat, refutable: bool) {
     (s.ann.post)(ann_node);
 }
 
-pub fn self_ty_to_str(self_ty: ast::self_ty_, intr: @ident_interner) -> ~str {
-    to_str(self_ty, |a, b| { print_self_ty(a, b); () }, intr)
+pub fn explicit_self_to_str(explicit_self: ast::explicit_self_, intr: @ident_interner) -> ~str {
+    to_str(explicit_self, |a, b| { print_explicit_self(a, b); () }, intr)
 }
 
 // Returns whether it printed anything
-pub fn print_self_ty(s: @ps, self_ty: ast::self_ty_) -> bool {
-    match self_ty {
+pub fn print_explicit_self(s: @ps, explicit_self: ast::explicit_self_) -> bool {
+    match explicit_self {
         ast::sty_static => { return false; }
         ast::sty_value => { word(s.s, ~"self"); }
         ast::sty_region(lt, m) => {
@@ -1657,24 +1657,24 @@ pub fn print_fn(s: @ps,
                 abis: AbiSet,
                 name: ast::ident,
                 generics: &ast::Generics,
-                opt_self_ty: Option<ast::self_ty_>,
+                opt_explicit_self: Option<ast::explicit_self_>,
                 vis: ast::visibility) {
     head(s, ~"");
-    print_fn_header_info(s, opt_self_ty, purity, abis, ast::Many, None, vis);
+    print_fn_header_info(s, opt_explicit_self, purity, abis, ast::Many, None, vis);
     nbsp(s);
     print_ident(s, name);
     print_generics(s, generics);
-    print_fn_args_and_ret(s, decl, opt_self_ty);
+    print_fn_args_and_ret(s, decl, opt_explicit_self);
 }
 
 pub fn print_fn_args(s: @ps, decl: &ast::fn_decl,
-                 opt_self_ty: Option<ast::self_ty_>) {
+                 opt_explicit_self: Option<ast::explicit_self_>) {
     // It is unfortunate to duplicate the commasep logic, but we we want the
     // self type and the args all in the same box.
     box(s, 0u, inconsistent);
     let mut first = true;
-    for opt_self_ty.each |self_ty| {
-        first = !print_self_ty(s, *self_ty);
+    for opt_explicit_self.each |explicit_self| {
+        first = !print_explicit_self(s, *explicit_self);
     }
 
     for decl.inputs.each |arg| {
@@ -1686,9 +1686,9 @@ pub fn print_fn_args(s: @ps, decl: &ast::fn_decl,
 }
 
 pub fn print_fn_args_and_ret(s: @ps, decl: &ast::fn_decl,
-                             opt_self_ty: Option<ast::self_ty_>) {
+                             opt_explicit_self: Option<ast::explicit_self_>) {
     popen(s);
-    print_fn_args(s, decl, opt_self_ty);
+    print_fn_args(s, decl, opt_explicit_self);
     pclose(s);
 
     maybe_print_comment(s, decl.output.span.lo);
@@ -1900,7 +1900,7 @@ pub fn print_ty_fn(s: @ps,
                    decl: &ast::fn_decl,
                    id: Option<ast::ident>,
                    generics: Option<&ast::Generics>,
-                   opt_self_ty: Option<ast::self_ty_>) {
+                   opt_explicit_self: Option<ast::explicit_self_>) {
     ibox(s, indent_unit);
 
     // Duplicates the logic in `print_fn_header_info()`.  This is because that
@@ -1920,8 +1920,8 @@ pub fn print_ty_fn(s: @ps,
     // self type and the args all in the same box.
     box(s, 0u, inconsistent);
     let mut first = true;
-    for opt_self_ty.each |self_ty| {
-        first = !print_self_ty(s, *self_ty);
+    for opt_explicit_self.each |explicit_self| {
+        first = !print_explicit_self(s, *explicit_self);
     }
     for decl.inputs.each |arg| {
         if first { first = false; } else { word_space(s, ~","); }
@@ -2163,7 +2163,7 @@ pub fn print_opt_sigil(s: @ps, opt_sigil: Option<ast::Sigil>) {
 }
 
 pub fn print_fn_header_info(s: @ps,
-                            _opt_sty: Option<ast::self_ty_>,
+                            _opt_explicit_self: Option<ast::explicit_self_>,
                             opt_purity: Option<ast::purity>,
                             abis: AbiSet,
                             onceness: ast::Onceness,