提交 5cedd66a 编写于 作者: E Eduard Burtescu

rustc: remove 3 dead functions in middle::ty.

上级 6db51262
......@@ -85,7 +85,7 @@
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(_) |
......
......@@ -128,7 +128,7 @@ fn visit_stmt(&mut self, s: &ast::Stmt) {
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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册