]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_borrowck/borrowck/gather_loans/move_error.rs
Imported Upstream version 1.4.0+dfsg1
[rustc.git] / src / librustc_borrowck / borrowck / gather_loans / move_error.rs
index 5baabebea116b57b5e080ed16bccaa3dbf7e7044..c39b1a9da07ea9547858d2a9047cbeed5f2c8c95 100644 (file)
@@ -15,7 +15,8 @@ use rustc::middle::ty;
 use std::cell::RefCell;
 use syntax::ast;
 use syntax::codemap;
-use syntax::print::pprust;
+use rustc_front::print::pprust;
+use rustc_front::hir;
 
 pub struct MoveErrorCollector<'tcx> {
     errors: RefCell<Vec<MoveError<'tcx>>>
@@ -125,7 +126,7 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
 
         mc::cat_interior(ref b, mc::InteriorElement(Kind::Index, _)) => {
             let expr = bccx.tcx.map.expect_expr(move_from.id);
-            if let ast::ExprIndex(..) = expr.node {
+            if let hir::ExprIndex(..) = expr.node {
                 bccx.span_err(move_from.span,
                               &format!("cannot move out of type `{}`, \
                                         a non-copy fixed-size array",
@@ -136,8 +137,8 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
         mc::cat_downcast(ref b, _) |
         mc::cat_interior(ref b, mc::InteriorField(_)) => {
             match b.ty.sty {
-                ty::TyStruct(did, _) |
-                ty::TyEnum(did, _) if bccx.tcx.has_dtor(did) => {
+                ty::TyStruct(def, _) |
+                ty::TyEnum(def, _) if def.has_dtor() => {
                     bccx.span_err(
                         move_from.span,
                         &format!("cannot move out of type `{}`, \