middle: typeck: check: remove dead code
This commit is contained in:
parent
39f839d9ee
commit
dcb01ff573
@ -510,27 +510,6 @@ fn check_fn<'a>(ccx: &'a CrateCtxt<'a>,
|
||||
fcx
|
||||
}
|
||||
|
||||
pub fn check_no_duplicate_fields(tcx: &ty::ctxt,
|
||||
fields: Vec<(ast::Ident, Span)>) {
|
||||
let mut field_names = HashMap::new();
|
||||
|
||||
for p in fields.iter() {
|
||||
let (id, sp) = *p;
|
||||
let orig_sp = field_names.find(&id).map(|x| *x);
|
||||
match orig_sp {
|
||||
Some(orig_sp) => {
|
||||
tcx.sess.span_err(sp, format!("duplicate field name {} in record type declaration",
|
||||
token::get_ident(id)));
|
||||
tcx.sess.span_note(orig_sp, "first declaration of this field occurred here");
|
||||
break;
|
||||
}
|
||||
None => {
|
||||
field_names.insert(id, sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check_struct(ccx: &CrateCtxt, id: ast::NodeId, span: Span) {
|
||||
let tcx = ccx.tcx;
|
||||
|
||||
@ -1010,10 +989,6 @@ impl<'a> FnCtxt<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn block_region(&self) -> ty::Region {
|
||||
ty::ReScope(self.region_lb.get())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn write_ty(&self, node_id: ast::NodeId, ty: ty::t) {
|
||||
debug!("write_ty({}, {}) in fcx {}",
|
||||
@ -1100,18 +1075,6 @@ impl<'a> FnCtxt<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn node_ty_substs(&self, id: ast::NodeId) -> ty::substs {
|
||||
match self.inh.node_type_substs.borrow().find(&id) {
|
||||
Some(ts) => (*ts).clone(),
|
||||
None => {
|
||||
self.tcx().sess.bug(
|
||||
format!("no type substs for node {}: {} in fcx {}",
|
||||
id, self.tcx().map.node_to_str(id),
|
||||
self.tag()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn method_ty_substs(&self, id: ast::NodeId) -> ty::substs {
|
||||
match self.inh.method_map.borrow().find(&MethodCall::expr(id)) {
|
||||
Some(method) => method.substs.clone(),
|
||||
@ -1167,11 +1130,6 @@ impl<'a> FnCtxt<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn can_mk_assignty(&self, sub: ty::t, sup: ty::t)
|
||||
-> Result<(), ty::type_err> {
|
||||
infer::can_mk_coercety(self.infcx(), sub, sup)
|
||||
}
|
||||
|
||||
pub fn mk_eqty(&self,
|
||||
a_is_expected: bool,
|
||||
origin: infer::TypeOrigin,
|
||||
@ -3300,10 +3258,6 @@ pub fn check_block_no_value(fcx: &FnCtxt, blk: &ast::Block) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check_block(fcx0: &FnCtxt, blk: &ast::Block) {
|
||||
check_block_with_expected(fcx0, blk, None)
|
||||
}
|
||||
|
||||
pub fn check_block_with_expected(fcx: &FnCtxt,
|
||||
blk: &ast::Block,
|
||||
expected: Option<ty::t>) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user