@@ -36,6 +36,7 @@ use dataflow::move_paths::{IllegalMoveOriginKind, MoveError};
36
36
use dataflow:: move_paths:: { HasMoveData , LookupResult , MoveData , MoveOutIndex , MovePathIndex } ;
37
37
use util:: borrowck_errors:: { BorrowckErrors , Origin } ;
38
38
39
+ use std:: fmt;
39
40
use std:: iter;
40
41
41
42
use self :: MutateMode :: { JustWrite , WriteAndRead } ;
@@ -308,8 +309,7 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
308
309
}
309
310
310
311
fn visit_block_entry ( & mut self , bb : BasicBlock , flow_state : & Self :: FlowState ) {
311
- let summary = flow_state. summary ( ) ;
312
- debug ! ( "MirBorrowckCtxt::process_block({:?}): {}" , bb, summary) ;
312
+ debug ! ( "MirBorrowckCtxt::process_block({:?}): {}" , bb, flow_state) ;
313
313
}
314
314
315
315
fn visit_statement_entry (
@@ -318,12 +318,11 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
318
318
stmt : & Statement < ' tcx > ,
319
319
flow_state : & Self :: FlowState ,
320
320
) {
321
- let summary = flow_state. summary ( ) ;
322
321
debug ! (
323
322
"MirBorrowckCtxt::process_statement({:?}, {:?}): {}" ,
324
323
location,
325
324
stmt,
326
- summary
325
+ flow_state
327
326
) ;
328
327
let span = stmt. source_info . span ;
329
328
match stmt. kind {
@@ -425,12 +424,11 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
425
424
flow_state : & Self :: FlowState ,
426
425
) {
427
426
let loc = location;
428
- let summary = flow_state. summary ( ) ;
429
427
debug ! (
430
428
"MirBorrowckCtxt::process_terminator({:?}, {:?}): {}" ,
431
429
location,
432
430
term,
433
- summary
431
+ flow_state
434
432
) ;
435
433
let span = term. source_info . span ;
436
434
match term. kind {
@@ -2679,8 +2677,10 @@ impl<'b, 'gcx, 'tcx> InProgress<'b, 'gcx, 'tcx> {
2679
2677
xform_move_outs ( & mut self . move_outs ) ;
2680
2678
xform_ever_inits ( & mut self . ever_inits ) ;
2681
2679
}
2680
+ }
2682
2681
2683
- fn summary ( & self ) -> String {
2682
+ impl < ' b , ' gcx , ' tcx > fmt:: Display for InProgress < ' b , ' gcx , ' tcx > {
2683
+ fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
2684
2684
let mut s = String :: new ( ) ;
2685
2685
2686
2686
s. push_str ( "borrows in effect: [" ) ;
@@ -2757,7 +2757,7 @@ impl<'b, 'gcx, 'tcx> InProgress<'b, 'gcx, 'tcx> {
2757
2757
} ) ;
2758
2758
s. push_str ( "]" ) ;
2759
2759
2760
- return s ;
2760
+ fmt :: Display :: fmt ( & s , fmt )
2761
2761
}
2762
2762
}
2763
2763
0 commit comments