]> git.lizzy.rs Git - rust.git/commitdiff
Finish de-implicit-selfing everything but the test suite
authorBen Striegel <ben.striegel@gmail.com>
Sat, 9 Mar 2013 00:34:39 +0000 (19:34 -0500)
committerBen Striegel <ben.striegel@gmail.com>
Sat, 9 Mar 2013 00:34:39 +0000 (19:34 -0500)
13 files changed:
src/libcore/core.rc
src/libfuzzer/fuzzer.rc
src/librust/rust.rc
src/librustc/middle/astencode.rs
src/librustc/middle/liveness.rs
src/librustc/middle/resolve.rs
src/librustc/middle/typeck/check/method.rs
src/librustc/middle/typeck/coherence.rs
src/librustc/middle/typeck/infer/mod.rs
src/librustc/rustc.rc
src/librustdoc/rustdoc.rc
src/librusti/rusti.rc
src/librustpkg/rustpkg.rc

index 42312d96d1becef1313d280581891bbaf4fbfb1c..4d686c8ab33a12b0736366df3caf0911319b692c 100644 (file)
@@ -51,6 +51,7 @@ Implicitly, all crates behave as if they included the following prologue:
 #[warn(vecs_implicitly_copyable)];
 #[deny(non_camel_case_types)];
 #[allow(deprecated_mutable_fields)];
+#[deny(deprecated_self)];
 
 // On Linux, link to the runtime with -lrt.
 #[cfg(target_os = "linux")]
index 19afbc4b2b7ff881e89235aacd8e8dd3509052de..f21029a8a4f0ff3d47b1710a92c11878840de5c6 100644 (file)
@@ -25,6 +25,7 @@
 #[allow(non_camel_case_types)];
 #[allow(deprecated_mode)];
 #[allow(deprecated_pattern)];
+#[deny(deprecated_self)];
 
 extern mod core(vers = "0.6");
 extern mod std(vers = "0.6");
index 023383b3dccc84d0517d8e5c50f4ae087e4a85c9..082861e0ae01ffbbf77b9232b561e4aad09eebbc 100644 (file)
@@ -12,6 +12,8 @@
 // XXX: Make commands run and test emit proper file endings on winds
 // XXX: Make run only accept source that emits an executable
 
+#[deny(deprecated_self)];
+
 #[link(name = "rust",
        vers = "0.6",
        uuid = "4a24da33-5cc8-4037-9352-2cbe9bd9d27c",
index 6f0bfbb197facfeb46d54542c133f072f62bdd79..48fddec00797acfe53f5a4203c92dacb3de832d2 100644 (file)
@@ -721,12 +721,12 @@ fn read_vtable_origin(&self, xcx: @ExtendedDecodeContext)
 // Encoding and decoding the side tables
 
 trait get_ty_str_ctxt {
-    fn ty_str_ctxt() -> @tyencode::ctxt;
+    fn ty_str_ctxt(@self) -> @tyencode::ctxt;
 }
 
-impl get_ty_str_ctxt for @e::EncodeContext {
+impl get_ty_str_ctxt for e::EncodeContext {
     // IMPLICIT SELF WARNING: fix this!
-    fn ty_str_ctxt() -> @tyencode::ctxt {
+    fn ty_str_ctxt(@self) -> @tyencode::ctxt {
         @tyencode::ctxt {diag: self.tcx.sess.diagnostic(),
                         ds: e::def_to_str,
                         tcx: self.tcx,
index f0c06ceca989c410caa527f898f2d28d64c7d52f..068327dc74167cb282299a378cfb84c6527c8959 100644 (file)
@@ -816,7 +816,7 @@ fn indices(&self, ln: LiveNode, op: fn(uint)) {
         }
     }
 
-    fn indices2(ln: LiveNode, succ_ln: LiveNode,
+    fn indices2(&self, ln: LiveNode, succ_ln: LiveNode,
                 op: fn(uint, uint)) {
         let node_base_idx = self.idx(ln, Variable(0u));
         let succ_base_idx = self.idx(succ_ln, Variable(0u));
index 391990eed95de92d66bf61ec966b55ff9bf2c1fc..d1e35f7a19df2a7d5663e03230d94a38ab7fe255 100644 (file)
@@ -592,7 +592,7 @@ fn define_value(@mut self, privacy: Privacy, def: def, sp: span) {
     }
 
     /// Returns the module node if applicable.
-    fn get_module_if_available() -> Option<@mut Module> {
+    fn get_module_if_available(&self) -> Option<@mut Module> {
         match self.type_def {
             Some(ref type_def) => (*type_def).module_def,
             None => None
@@ -613,14 +613,14 @@ fn get_module(@mut self) -> @mut Module {
         }
     }
 
-    fn defined_in_namespace(namespace: Namespace) -> bool {
+    fn defined_in_namespace(&self, namespace: Namespace) -> bool {
         match namespace {
             TypeNS   => return self.type_def.is_some(),
             ValueNS  => return self.value_def.is_some()
         }
     }
 
-    fn defined_in_public_namespace(namespace: Namespace) -> bool {
+    fn defined_in_public_namespace(&self, namespace: Namespace) -> bool {
         match namespace {
             TypeNS => match self.type_def {
                 Some(def) => def.privacy != Private,
@@ -633,7 +633,7 @@ fn defined_in_public_namespace(namespace: Namespace) -> bool {
         }
     }
 
-    fn def_for_namespace(namespace: Namespace) -> Option<def> {
+    fn def_for_namespace(&self, namespace: Namespace) -> Option<def> {
         match namespace {
             TypeNS => {
                 match self.type_def {
@@ -666,7 +666,7 @@ fn def_for_namespace(namespace: Namespace) -> Option<def> {
         }
     }
 
-    fn privacy_for_namespace(namespace: Namespace) -> Option<Privacy> {
+    fn privacy_for_namespace(&self, namespace: Namespace) -> Option<Privacy> {
         match namespace {
             TypeNS => {
                 match self.type_def {
@@ -683,7 +683,7 @@ fn privacy_for_namespace(namespace: Namespace) -> Option<Privacy> {
         }
     }
 
-    fn span_for_namespace(namespace: Namespace) -> Option<span> {
+    fn span_for_namespace(&self, namespace: Namespace) -> Option<span> {
         if self.defined_in_namespace(namespace) {
             match namespace {
                 TypeNS  => self.type_span,
index 0bcbb3012cf1004b01a964e50b56b696df32f3c7..3395d9b445146c07f4c81189bf6f219ad7930464 100644 (file)
@@ -235,7 +235,8 @@ fn do_lookup(&self, self_ty: ty::t) -> Option<method_map_entry> {
         self.search_for_autosliced_method(self_ty, autoderefs)
     }
 
-    fn deref(ty: ty::t, enum_dids: &mut ~[ast::def_id]) -> Option<ty::t> {
+    fn deref(&self, ty: ty::t, enum_dids: &mut ~[ast::def_id])
+            -> Option<ty::t> {
         match ty::get(ty).sty {
             ty_enum(did, _) => {
                 // Watch out for newtype'd enums like "enum t = @T".
@@ -599,7 +600,7 @@ fn push_inherent_candidates_from_self(&self,
         }
     }
 
-    fn push_inherent_impl_candidates_for_type(did: def_id) {
+    fn push_inherent_impl_candidates_for_type(&self, did: def_id) {
         let opt_impl_infos =
             self.fcx.ccx.coherence_info.inherent_methods.find(&did);
         for opt_impl_infos.each |impl_infos| {
index 3e45323807212ac77485270d26d608cd1e02d24d..00352ba29582a2a75f5c56e4953c1708f08d3639 100644 (file)
@@ -191,15 +191,14 @@ pub struct CoherenceChecker {
 }
 
 pub impl CoherenceChecker {
-    // IMPLICIT SELF WARNING: fix this!
-    fn check_coherence(crate: @crate) {
+    fn check_coherence(self, crate: @crate) {
         // Check implementations and traits. This populates the tables
         // containing the inherent methods and extension methods. It also
         // builds up the trait inheritance table.
         visit_crate(*crate, (), mk_simple_visitor(@SimpleVisitor {
             visit_item: |item| {
-                debug!("(checking coherence) item '%s'",
-                       *self.crate_context.tcx.sess.str_of(item.ident));
+//                debug!("(checking coherence) item '%s'",
+//                       self.crate_context.tcx.sess.str_of(item.ident));
 
                 match item.node {
                     item_impl(_, opt_trait, _, _) => {
@@ -617,8 +616,7 @@ fn get_self_type_for_implementation(&self, implementation: @Impl)
     }
 
     // Privileged scope checking
-    // IMPLICIT SELF WARNING: fix this!
-    fn check_privileged_scopes(crate: @crate) {
+    fn check_privileged_scopes(self, crate: @crate) {
         visit_crate(*crate, (), mk_vt(@Visitor {
             visit_item: |item, _context, visitor| {
                 match /*bad*/copy item.node {
index 9cb6c473d586ba9a464cc34904c3ef382a54dcb9..a334ba57e6e04db0831ac9cae5767c9f47ce5967 100644 (file)
@@ -584,7 +584,7 @@ fn rollback_to(&self, snapshot: &Snapshot) {
     }
 
     /// Execute `f` and commit the bindings if successful
-    fn commit<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
+    fn commit<T,E>(&self, f: fn() -> Result<T,E>) -> Result<T,E> {
         fail_unless!(!self.in_snapshot());
 
         debug!("commit()");
@@ -599,7 +599,7 @@ fn commit<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
     }
 
     /// Execute `f`, unroll bindings on failure
-    fn try<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
+    fn try<T,E>(&self, f: fn() -> Result<T,E>) -> Result<T,E> {
         debug!("try()");
         do indent {
             let snapshot = self.start_snapshot();
@@ -613,7 +613,7 @@ fn try<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
     }
 
     /// Execute `f` then unroll any bindings it creates
-    fn probe<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
+    fn probe<T,E>(&self, f: fn() -> Result<T,E>) -> Result<T,E> {
         debug!("probe()");
         do indent {
             let snapshot = self.start_snapshot();
index 355ecaed7d7e0a6d7ba6d8f651e35df67869fc5f..296c94f3299cb2040357e493d1fed729dd39e4ac 100644 (file)
@@ -24,7 +24,7 @@
 #[allow(non_camel_case_types)];
 #[allow(deprecated_mode)];
 #[warn(deprecated_pattern)];
-#[allow(deprecated_self)];
+#[deny(deprecated_self)];
 
 #[no_core];
 
index 9bd78e54b78bea2fa9dc83ce0e94e2924dbd436b..f17f7ffd9cf4a20a99c1e952e20898546657aea6 100644 (file)
@@ -22,6 +22,7 @@
 #[no_core];
 
 #[allow(non_implicitly_copyable_typarams)];
+#[deny(deprecated_self)];
 
 extern mod core(vers = "0.6");
 extern mod std(vers = "0.6");
index 3e1b0c03bd70272af993d82091e01a61f3e4dc21..6674885a6e28ac8b1145cad44388353bf1589fe0 100644 (file)
@@ -22,6 +22,7 @@
 
 #[allow(vecs_implicitly_copyable,
         non_implicitly_copyable_typarams)];
+#[deny(deprecated_self)];
 
 extern mod core(vers = "0.6");
 extern mod std(vers = "0.6");
index 0f8463b0b3c93879a6f7ae05f344f8195556556c..5b9f3c3cd229edf38457b7a5a59cce7d6449daeb 100644 (file)
@@ -20,6 +20,7 @@
 #[no_core];
 #[allow(vecs_implicitly_copyable,
         non_implicitly_copyable_typarams)];
+#[deny(deprecated_self)];
 
 extern mod core(vers = "0.6");
 extern mod std(vers = "0.6");