typeck: remove dead code
This commit is contained in:
parent
643826150b
commit
8d0d7521d6
3 changed files with 3 additions and 23 deletions
|
@ -13,20 +13,18 @@
|
||||||
use super::{check_fn, Expectation, FnCtxt};
|
use super::{check_fn, Expectation, FnCtxt};
|
||||||
|
|
||||||
use astconv;
|
use astconv;
|
||||||
use middle::infer;
|
|
||||||
use middle::region::CodeExtent;
|
use middle::region::CodeExtent;
|
||||||
use middle::subst;
|
use middle::subst;
|
||||||
use middle::ty::{self, ToPolyTraitRef, Ty};
|
use middle::ty::{self, ToPolyTraitRef, Ty};
|
||||||
use rscope::RegionScope;
|
use rscope::RegionScope;
|
||||||
use syntax::abi;
|
use syntax::abi;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use syntax::ast::CaptureClause::*;
|
|
||||||
use syntax::ast_util;
|
use syntax::ast_util;
|
||||||
use util::ppaux::Repr;
|
use util::ppaux::Repr;
|
||||||
|
|
||||||
pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
|
pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
|
||||||
expr: &ast::Expr,
|
expr: &ast::Expr,
|
||||||
capture: ast::CaptureClause,
|
_capture: ast::CaptureClause,
|
||||||
opt_kind: Option<ast::UnboxedClosureKind>,
|
opt_kind: Option<ast::UnboxedClosureKind>,
|
||||||
decl: &ast::FnDecl,
|
decl: &ast::FnDecl,
|
||||||
body: &ast::Block,
|
body: &ast::Block,
|
||||||
|
|
|
@ -856,10 +856,8 @@ fn check_expr_fn_block(rcx: &mut Rcx,
|
||||||
|
|
||||||
fn constrain_callee(rcx: &mut Rcx,
|
fn constrain_callee(rcx: &mut Rcx,
|
||||||
callee_id: ast::NodeId,
|
callee_id: ast::NodeId,
|
||||||
call_expr: &ast::Expr,
|
_call_expr: &ast::Expr,
|
||||||
callee_expr: &ast::Expr) {
|
_callee_expr: &ast::Expr) {
|
||||||
let call_region = ty::ReScope(CodeExtent::from_node_id(call_expr.id));
|
|
||||||
|
|
||||||
let callee_ty = rcx.resolve_node_type(callee_id);
|
let callee_ty = rcx.resolve_node_type(callee_id);
|
||||||
match callee_ty.sty {
|
match callee_ty.sty {
|
||||||
ty::ty_bare_fn(..) => { }
|
ty::ty_bare_fn(..) => { }
|
||||||
|
|
|
@ -319,22 +319,6 @@ impl<'a, 'tcx> Wf<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn accumulate_from_closure_ty(&mut self,
|
|
||||||
ty: Ty<'tcx>,
|
|
||||||
c: &ty::ClosureTy<'tcx>)
|
|
||||||
{
|
|
||||||
match c.store {
|
|
||||||
ty::RegionTraitStore(r_b, _) => {
|
|
||||||
self.push_region_constraint_from_top(r_b);
|
|
||||||
}
|
|
||||||
ty::UniqTraitStore => { }
|
|
||||||
}
|
|
||||||
|
|
||||||
let required_region_bounds =
|
|
||||||
ty::object_region_bounds(self.tcx, None, c.bounds.builtin_bounds);
|
|
||||||
self.accumulate_from_object_ty(ty, c.bounds.region_bound, required_region_bounds);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn accumulate_from_object_ty(&mut self,
|
fn accumulate_from_object_ty(&mut self,
|
||||||
ty: Ty<'tcx>,
|
ty: Ty<'tcx>,
|
||||||
region_bound: ty::Region,
|
region_bound: ty::Region,
|
||||||
|
|
Loading…
Add table
Reference in a new issue