about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2015-06-25 04:10:11 +0300
committerEduard Burtescu <edy.burt@gmail.com>2015-06-26 07:34:56 +0300
commit5cedd66a6c37ed04377aeea92db092f343bfe152 (patch)
tree7840e6a2c038c4c6acca2b308c09e6999ee03b4b
parent6db5126240b6420630553b930417fca10986d75d (diff)
downloadrust-5cedd66a6c37ed04377aeea92db092f343bfe152.tar.gz
rust-5cedd66a6c37ed04377aeea92db092f343bfe152.zip
rustc: remove 3 dead functions in middle::ty.
-rw-r--r--src/librustc/middle/ty.rs23
-rw-r--r--src/librustc_typeck/check/writeback.rs2
2 files changed, 2 insertions, 23 deletions
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs
index 51fb11f7452..185a04bc521 100644
--- a/src/librustc/middle/ty.rs
+++ b/src/librustc/middle/ty.rs
@@ -85,7 +85,7 @@ use std::collections::{HashMap, HashSet};
 use syntax::abi;
 use syntax::ast::{CrateNum, DefId, ItemImpl, ItemTrait, LOCAL_CRATE};
 use syntax::ast::{MutImmutable, MutMutable, Name, NamedField, NodeId};
-use syntax::ast::{StmtExpr, StmtSemi, StructField, UnnamedField, Visibility};
+use syntax::ast::{StructField, UnnamedField, Visibility};
 use syntax::ast_util::{self, is_local, local_def};
 use syntax::attr::{self, AttrMetaMethods, SignedInt, UnsignedInt};
 use syntax::codemap::Span;
@@ -1840,13 +1840,6 @@ pub enum BuiltinBound {
     Sync,
 }
 
-/// An existential bound that does not implement any traits.
-pub fn region_existential_bound<'tcx>(r: ty::Region) -> ExistentialBounds<'tcx> {
-    ty::ExistentialBounds { region_bound: r,
-                            builtin_bounds: BuiltinBounds::empty(),
-                            projection_bounds: Vec::new() }
-}
-
 impl CLike for BuiltinBound {
     fn to_usize(&self) -> usize {
         *self as usize
@@ -5004,15 +4997,6 @@ pub fn expr_is_lval(tcx: &ctxt, expr: &ast::Expr) -> bool {
     }
 }
 
-pub fn stmt_node_id(s: &ast::Stmt) -> ast::NodeId {
-    match s.node {
-      ast::StmtDecl(_, id) | StmtExpr(_, id) | StmtSemi(_, id) => {
-        return id;
-      }
-      ast::StmtMac(..) => panic!("unexpanded macro in trans")
-    }
-}
-
 pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field])
                      -> usize {
     let mut i = 0;
@@ -5025,11 +5009,6 @@ pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field])
               .collect::<Vec<String>>()));
 }
 
-pub fn impl_or_trait_item_idx(id: ast::Name, trait_items: &[ImplOrTraitItem])
-                              -> Option<usize> {
-    trait_items.iter().position(|m| m.name() == id)
-}
-
 pub fn ty_sort_string(cx: &ctxt, ty: Ty) -> String {
     match ty.sty {
         TyBool | TyChar | TyInt(_) |
diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs
index 2bf8c5b5faf..9abee1a3aaa 100644
--- a/src/librustc_typeck/check/writeback.rs
+++ b/src/librustc_typeck/check/writeback.rs
@@ -128,7 +128,7 @@ impl<'cx, 'tcx, 'v> Visitor<'v> for WritebackCx<'cx, 'tcx> {
             return;
         }
 
-        self.visit_node_id(ResolvingExpr(s.span), ty::stmt_node_id(s));
+        self.visit_node_id(ResolvingExpr(s.span), ast_util::stmt_id(s));
         visit::walk_stmt(self, s);
     }