about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2013-02-26 14:34:00 -0500
committerNiko Matsakis <niko@alum.mit.edu>2013-03-06 15:12:57 -0500
commit3168fe06ff69970be329583f560a3ccd9c00c874 (patch)
tree1c84b080a887c23434f4049fd701413d7b2a49af /src/libsyntax
parent876b6ba792f83f1b50d1356e7305f334b5ba2f05 (diff)
downloadrust-3168fe06ff69970be329583f560a3ccd9c00c874.tar.gz
rust-3168fe06ff69970be329583f560a3ccd9c00c874.zip
Add manual &self/ and &static/ and /&self declarations that
are currently inferred.  New rules are coming that will require
them to be explicit.  All add some explicit self declarations.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/deriving.rs22
-rw-r--r--src/libsyntax/ext/expand.rs9
-rw-r--r--src/libsyntax/print/pprust.rs4
-rw-r--r--src/libsyntax/visit.rs10
4 files changed, 22 insertions, 23 deletions
diff --git a/src/libsyntax/ext/deriving.rs b/src/libsyntax/ext/deriving.rs
index 07896236442..8c12bbad360 100644
--- a/src/libsyntax/ext/deriving.rs
+++ b/src/libsyntax/ext/deriving.rs
@@ -46,18 +46,16 @@ pub impl Junction {
     }
 }
 
-type ExpandDerivingStructDefFn = &fn(ext_ctxt,
-                                     span,
-                                     x: &struct_def,
-                                     ident,
-                                     y: &Generics)
-                                  -> @item;
-type ExpandDerivingEnumDefFn = &fn(ext_ctxt,
-                                   span,
-                                   x: &enum_def,
-                                   ident,
-                                   y: &Generics)
-                                -> @item;
+type ExpandDerivingStructDefFn = &self/fn(ext_ctxt,
+                                          span,
+                                          x: &struct_def,
+                                          ident,
+                                          y: &Generics) -> @item;
+type ExpandDerivingEnumDefFn = &self/fn(ext_ctxt,
+                                        span,
+                                        x: &enum_def,
+                                        ident,
+                                        y: &Generics) -> @item;
 
 pub fn expand_deriving_eq(cx: ext_ctxt,
                           span: span,
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 03633a89a86..7b4f92ab3ca 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -442,11 +442,12 @@ pub fn core_macros() -> ~str {
             mod $c {
                 fn key(_x: @::core::condition::Handler<$in,$out>) { }
 
-                pub const cond : ::core::condition::Condition<$in,$out> =
+                pub const cond :
+                    ::core::condition::Condition/&static<$in,$out> =
                     ::core::condition::Condition {
-                    name: stringify!($c),
-                    key: key
-                };
+                        name: stringify!($c),
+                        key: key
+                    };
             }
         }
     )
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 275f5a43397..3b4b198e595 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -35,8 +35,8 @@ use core::u64;
 use core::vec;
 
 // The @ps is stored here to prevent recursive type.
-pub enum ann_node/& {
-    node_block(@ps, &ast::blk),
+pub enum ann_node<'self> {
+    node_block(@ps, &'self ast::blk),
     node_item(@ps, @ast::item),
     node_expr(@ps, @ast::expr),
     node_pat(@ps, @ast::pat),
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 4cc97dad97c..5e97793b480 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -28,14 +28,14 @@ use opt_vec::OptVec;
 // hold functions that take visitors. A vt enum is used to break the cycle.
 pub enum vt<E> { mk_vt(visitor<E>), }
 
-pub enum fn_kind {
-    fk_item_fn(ident, &Generics, purity),   // fn foo()
-    fk_method(ident, &Generics, &method),   // fn foo(&self)
+pub enum fn_kind<'self> {
+    fk_item_fn(ident, &'self Generics, purity),   // fn foo()
+    fk_method(ident, &'self Generics, &'self method),   // fn foo(&self)
     fk_anon(ast::Sigil),                    // fn@(x, y) { ... }
     fk_fn_block,                            // |x, y| ...
     fk_dtor( // class destructor
-        &Generics,
-        &[attribute],
+        &'self Generics,
+        &'self [attribute],
         node_id /* self id */,
         def_id /* parent class id */
     )