Skip to content

Commit

Permalink
rustc: remove 3 dead functions in middle::ty.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jun 26, 2015
1 parent 6db5126 commit 5cedd66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
23 changes: 1 addition & 22 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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(_) |
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/writeback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5cedd66

Please sign in to comment.