about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2014-04-01 10:26:34 -0400
committerCorey Richardson <corey@octayn.net>2014-04-02 11:17:20 -0400
commitdc59df776a18956365f2b8f0ee026aca37891acb (patch)
tree83bada875f1cbfa72c5df1369f3ebd3a251edfc1
parent393bc08762de9d24517bce260e2d2564074d3aa9 (diff)
middle: mem_categorization: remove dead code
-rw-r--r--src/librustc/middle/mem_categorization.rs65
1 files changed, 1 insertions, 64 deletions
diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs
index 3604499add6..e376e66ca6f 100644
--- a/src/librustc/middle/mem_categorization.rs
+++ b/src/librustc/middle/mem_categorization.rs
@@ -64,7 +64,7 @@
 
 use middle::ty;
 use middle::typeck;
-use util::ppaux::{ty_to_str, region_ptr_to_str, Repr};
+use util::ppaux::{ty_to_str, Repr};
 
 use syntax::ast::{MutImmutable, MutMutable};
 use syntax::ast;
@@ -674,20 +674,6 @@ impl<TYPER:Typer> MemCategorizationContext<TYPER> {
         }
     }
 
-    /// inherited mutability: used in cases where the mutability of a
-    /// component is inherited from the base it is a part of. For
-    /// example, a record field is mutable if it is declared mutable
-    /// or if the container is mutable.
-    pub fn inherited_mutability(&mut self,
-                                base_m: MutabilityCategory,
-                                interior_m: ast::Mutability)
-                                -> MutabilityCategory {
-        match interior_m {
-            MutImmutable => base_m.inherit(),
-            MutMutable => McDeclared
-        }
-    }
-
     pub fn cat_field<N:ast_node>(&mut self,
                                  node: &N,
                                  base_cmt: cmt,
@@ -1114,13 +1100,6 @@ impl<TYPER:Typer> MemCategorizationContext<TYPER> {
         Ok(())
     }
 
-    pub fn mut_to_str(&mut self, mutbl: ast::Mutability) -> ~str {
-        match mutbl {
-          MutMutable => ~"mutable",
-          MutImmutable => ~"immutable"
-        }
-    }
-
     pub fn cmt_to_str(&self, cmt: cmt) -> ~str {
         match cmt.cat {
           cat_static_item => {
@@ -1174,48 +1153,6 @@ impl<TYPER:Typer> MemCategorizationContext<TYPER> {
           }
         }
     }
-
-    pub fn region_to_str(&self, r: ty::Region) -> ~str {
-        region_ptr_to_str(self.tcx(), r)
-    }
-}
-
-/// The node_id here is the node of the expression that references the field.
-/// This function looks it up in the def map in case the type happens to be
-/// an enum to determine which variant is in use.
-pub fn field_mutbl(tcx: &ty::ctxt,
-                   base_ty: ty::t,
-                   // FIXME #6993: change type to Name
-                   f_name: ast::Ident,
-                   node_id: ast::NodeId)
-                -> Option<ast::Mutability> {
-    // Need to refactor so that struct/enum fields can be treated uniformly.
-    match ty::get(base_ty).sty {
-      ty::ty_struct(did, _) => {
-        let r = ty::lookup_struct_fields(tcx, did);
-        for fld in r.iter() {
-            if fld.name == f_name.name {
-                return Some(ast::MutImmutable);
-            }
-        }
-      }
-      ty::ty_enum(..) => {
-        match tcx.def_map.borrow().get_copy(&node_id) {
-          ast::DefVariant(_, variant_id, _) => {
-            let r = ty::lookup_struct_fields(tcx, variant_id);
-            for fld in r.iter() {
-                if fld.name == f_name.name {
-                    return Some(ast::MutImmutable);
-                }
-            }
-          }
-          _ => {}
-        }
-      }
-      _ => { }
-    }
-
-    return None;
 }
 
 pub enum InteriorSafety {