}
fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
- if let hir::ExprKind::Closure(cc, _, body_id, _, _) = expr.node {
+ if let hir::ExprKind::Closure(cc, _, body_id, _, _) = expr.kind {
let body = self.fcx.tcx.hir().body(body_id);
self.visit_body(body);
self.fcx
// Extract the type of the closure.
let ty = self.node_ty(closure_hir_id);
- let (closure_def_id, substs) = match ty.sty {
+ let (closure_def_id, substs) = match ty.kind {
ty::Closure(def_id, substs) => (def_id, UpvarSubsts::Closure(substs)),
ty::Generator(def_id, substs, _) => (def_id, UpvarSubsts::Generator(substs)),
ty::Error => {
euv::Copy => {
return;
}
- euv::Move(_) => {}
+ euv::Move => {}
}
let tcx = self.fcx.tcx;
Categorization::Deref(_, mc::UnsafePtr(..))
| Categorization::StaticItem
- | Categorization::ThreadLocal(..)
- | Categorization::Rvalue(..)
+ | Categorization::ThreadLocal
+ | Categorization::Rvalue
| Categorization::Local(_)
| Categorization::Upvar(..) => {
return;
Categorization::Deref(_, mc::UnsafePtr(..))
| Categorization::StaticItem
- | Categorization::ThreadLocal(..)
- | Categorization::Rvalue(..)
+ | Categorization::ThreadLocal
+ | Categorization::Rvalue
| Categorization::Local(_)
| Categorization::Upvar(..) => {}
}
}
impl<'a, 'tcx> euv::Delegate<'tcx> for InferBorrowKind<'a, 'tcx> {
- fn consume(
- &mut self,
- _consume_id: hir::HirId,
- _consume_span: Span,
- cmt: &mc::cmt_<'tcx>,
- mode: euv::ConsumeMode,
- ) {
+ fn consume(&mut self, cmt: &mc::cmt_<'tcx>,mode: euv::ConsumeMode) {
debug!("consume(cmt={:?},mode={:?})", cmt, mode);
self.adjust_upvar_borrow_kind_for_consume(cmt, mode);
}
- fn matched_pat(
- &mut self,
- _matched_pat: &hir::Pat,
- _cmt: &mc::cmt_<'tcx>,
- _mode: euv::MatchMode,
- ) {
- }
-
- fn consume_pat(
- &mut self,
- _consume_pat: &hir::Pat,
- cmt: &mc::cmt_<'tcx>,
- mode: euv::ConsumeMode,
- ) {
- debug!("consume_pat(cmt={:?},mode={:?})", cmt, mode);
- self.adjust_upvar_borrow_kind_for_consume(cmt, mode);
- }
-
- fn borrow(
- &mut self,
- borrow_id: hir::HirId,
- _borrow_span: Span,
- cmt: &mc::cmt_<'tcx>,
- _loan_region: ty::Region<'tcx>,
- bk: ty::BorrowKind,
- _loan_cause: euv::LoanCause,
- ) {
- debug!(
- "borrow(borrow_id={}, cmt={:?}, bk={:?})",
- borrow_id, cmt, bk
- );
+ fn borrow(&mut self, cmt: &mc::cmt_<'tcx>, bk: ty::BorrowKind) {
+ debug!("borrow(cmt={:?}, bk={:?})", cmt, bk);
match bk {
ty::ImmBorrow => {}
}
}
- fn decl_without_init(&mut self, _id: hir::HirId, _span: Span) {}
-
- fn mutate(
- &mut self,
- _assignment_id: hir::HirId,
- _assignment_span: Span,
- assignee_cmt: &mc::cmt_<'tcx>,
- _mode: euv::MutateMode,
- ) {
+ fn mutate(&mut self, assignee_cmt: &mc::cmt_<'tcx>) {
debug!("mutate(assignee_cmt={:?})", assignee_cmt);
self.adjust_upvar_borrow_kind_for_mut(assignee_cmt);