Skip to content

Commit 5cedd66

Browse files
committed
rustc: remove 3 dead functions in middle::ty.
1 parent 6db5126 commit 5cedd66

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

src/librustc/middle/ty.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ use std::collections::{HashMap, HashSet};
8585
use syntax::abi;
8686
use syntax::ast::{CrateNum, DefId, ItemImpl, ItemTrait, LOCAL_CRATE};
8787
use syntax::ast::{MutImmutable, MutMutable, Name, NamedField, NodeId};
88-
use syntax::ast::{StmtExpr, StmtSemi, StructField, UnnamedField, Visibility};
88+
use syntax::ast::{StructField, UnnamedField, Visibility};
8989
use syntax::ast_util::{self, is_local, local_def};
9090
use syntax::attr::{self, AttrMetaMethods, SignedInt, UnsignedInt};
9191
use syntax::codemap::Span;
@@ -1840,13 +1840,6 @@ pub enum BuiltinBound {
18401840
Sync,
18411841
}
18421842

1843-
/// An existential bound that does not implement any traits.
1844-
pub fn region_existential_bound<'tcx>(r: ty::Region) -> ExistentialBounds<'tcx> {
1845-
ty::ExistentialBounds { region_bound: r,
1846-
builtin_bounds: BuiltinBounds::empty(),
1847-
projection_bounds: Vec::new() }
1848-
}
1849-
18501843
impl CLike for BuiltinBound {
18511844
fn to_usize(&self) -> usize {
18521845
*self as usize
@@ -5004,15 +4997,6 @@ pub fn expr_is_lval(tcx: &ctxt, expr: &ast::Expr) -> bool {
50044997
}
50054998
}
50064999

5007-
pub fn stmt_node_id(s: &ast::Stmt) -> ast::NodeId {
5008-
match s.node {
5009-
ast::StmtDecl(_, id) | StmtExpr(_, id) | StmtSemi(_, id) => {
5010-
return id;
5011-
}
5012-
ast::StmtMac(..) => panic!("unexpanded macro in trans")
5013-
}
5014-
}
5015-
50165000
pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field])
50175001
-> usize {
50185002
let mut i = 0;
@@ -5025,11 +5009,6 @@ pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field])
50255009
.collect::<Vec<String>>()));
50265010
}
50275011

5028-
pub fn impl_or_trait_item_idx(id: ast::Name, trait_items: &[ImplOrTraitItem])
5029-
-> Option<usize> {
5030-
trait_items.iter().position(|m| m.name() == id)
5031-
}
5032-
50335012
pub fn ty_sort_string(cx: &ctxt, ty: Ty) -> String {
50345013
match ty.sty {
50355014
TyBool | TyChar | TyInt(_) |

src/librustc_typeck/check/writeback.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl<'cx, 'tcx, 'v> Visitor<'v> for WritebackCx<'cx, 'tcx> {
128128
return;
129129
}
130130

131-
self.visit_node_id(ResolvingExpr(s.span), ty::stmt_node_id(s));
131+
self.visit_node_id(ResolvingExpr(s.span), ast_util::stmt_id(s));
132132
visit::walk_stmt(self, s);
133133
}
134134

0 commit comments

Comments
 (0)