Skip to content

Commit 51b0552

Browse files
committed
Added some debug logging.
1 parent f45f525 commit 51b0552

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/librustc_mir/borrow_check/move_errors.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
221221
| GroupedMoveError::OtherIllegalMove { span, ref kind } => (span, kind),
222222
};
223223
let origin = Origin::Mir;
224+
debug!("report: span={:?}, kind={:?}", span, kind);
224225
(
225226
match kind {
226227
IllegalMoveOriginKind::Static => {
@@ -262,6 +263,10 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
262263
}
263264
None => bug!("closure kind not inferred by borrowck"),
264265
};
266+
debug!("report: closure_kind_ty={:?} closure_kind={:?} \
267+
place_description={:?}", closure_kind_ty, closure_kind,
268+
place_description);
269+
265270
self.tcx.cannot_move_out_of(span, place_description, origin)
266271
}
267272
_ => self

src/librustc_mir/borrow_check/mutability_errors.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
3636
error_access: AccessKind,
3737
location: Location,
3838
) {
39+
debug!(
40+
"report_mutability_error(\
41+
access_place={:?}, span={:?}, the_place_err={:?}, error_access={:?}, location={:?},\
42+
)",
43+
access_place, span, the_place_err, error_access, location,
44+
);
45+
3946
let mut err;
4047
let item_msg;
4148
let reason;
4249
let access_place_desc = self.describe_place(access_place);
50+
debug!("report_mutability_error: access_place_desc={:?}", access_place_desc);
4351

4452
match the_place_err {
4553
Place::Local(local) => {
@@ -155,6 +163,8 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
155163
}) => bug!("Unexpected immutable place."),
156164
}
157165

166+
debug!("report_mutability_error: item_msg={:?}, reason={:?}", item_msg, reason);
167+
158168
// `act` and `acted_on` are strings that let us abstract over
159169
// the verbs used in some diagnostic messages.
160170
let act;
@@ -199,6 +209,8 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
199209
}
200210
};
201211

212+
debug!("report_mutability_error: act={:?}, acted_on={:?}", act, acted_on);
213+
202214
match the_place_err {
203215
// We want to suggest users use `let mut` for local (user
204216
// variable) mutations...

0 commit comments

Comments
 (0)