about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2018-08-07 15:37:32 +0200
committerDavid Wood <david@davidtw.co>2018-08-14 17:36:00 +0200
commit51b0552bd7c32cf41317e81616f1f005328a68e7 (patch)
tree7c2682ed8ed882435b8a1567bc42fb8a74e30e71
parentf45f52532a394d2d607fc5693364ad820049376d (diff)
downloadrust-51b0552bd7c32cf41317e81616f1f005328a68e7.tar.gz
rust-51b0552bd7c32cf41317e81616f1f005328a68e7.zip
Added some debug logging.
-rw-r--r--src/librustc_mir/borrow_check/move_errors.rs5
-rw-r--r--src/librustc_mir/borrow_check/mutability_errors.rs12
2 files changed, 17 insertions, 0 deletions
diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs
index 4d988fef450..86bbec795b0 100644
--- a/src/librustc_mir/borrow_check/move_errors.rs
+++ b/src/librustc_mir/borrow_check/move_errors.rs
@@ -221,6 +221,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
                 | GroupedMoveError::OtherIllegalMove { span, ref kind } => (span, kind),
             };
             let origin = Origin::Mir;
+            debug!("report: span={:?}, kind={:?}", span, kind);
             (
                 match kind {
                     IllegalMoveOriginKind::Static => {
@@ -262,6 +263,10 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
                                     }
                                     None => bug!("closure kind not inferred by borrowck"),
                                 };
+                                debug!("report: closure_kind_ty={:?} closure_kind={:?} \
+                                       place_description={:?}", closure_kind_ty, closure_kind,
+                                       place_description);
+
                                 self.tcx.cannot_move_out_of(span, place_description, origin)
                             }
                             _ => self
diff --git a/src/librustc_mir/borrow_check/mutability_errors.rs b/src/librustc_mir/borrow_check/mutability_errors.rs
index e8862320ddf..25428d2c424 100644
--- a/src/librustc_mir/borrow_check/mutability_errors.rs
+++ b/src/librustc_mir/borrow_check/mutability_errors.rs
@@ -36,10 +36,18 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
         error_access: AccessKind,
         location: Location,
     ) {
+        debug!(
+            "report_mutability_error(\
+                access_place={:?}, span={:?}, the_place_err={:?}, error_access={:?}, location={:?},\
+            )",
+            access_place, span, the_place_err, error_access, location,
+        );
+
         let mut err;
         let item_msg;
         let reason;
         let access_place_desc = self.describe_place(access_place);
+        debug!("report_mutability_error: access_place_desc={:?}", access_place_desc);
 
         match the_place_err {
             Place::Local(local) => {
@@ -155,6 +163,8 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
             }) => bug!("Unexpected immutable place."),
         }
 
+        debug!("report_mutability_error: item_msg={:?}, reason={:?}", item_msg, reason);
+
         // `act` and `acted_on` are strings that let us abstract over
         // the verbs used in some diagnostic messages.
         let act;
@@ -199,6 +209,8 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
             }
         };
 
+        debug!("report_mutability_error: act={:?}, acted_on={:?}", act, acted_on);
+
         match the_place_err {
             // We want to suggest users use `let mut` for local (user
             // variable) mutations...