about summary refs log tree commit diff
path: root/src/libsyntax/ext
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/ext
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/ext')
-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
13 files changed, 31 insertions, 32 deletions
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 => {