@@ -104,33 +104,9 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
104
104
let mut bccx = BorrowckCtxt {
105
105
tcx : tcx,
106
106
tables : None ,
107
- stats : BorrowStats {
108
- loaned_paths_same : 0 ,
109
- loaned_paths_imm : 0 ,
110
- stable_paths : 0 ,
111
- guaranteed_paths : 0
112
- }
113
107
} ;
114
108
115
109
tcx. visit_all_item_likes_in_krate ( DepNode :: BorrowCheck , & mut bccx. as_deep_visitor ( ) ) ;
116
-
117
- if tcx. sess . borrowck_stats ( ) {
118
- println ! ( "--- borrowck stats ---" ) ;
119
- println ! ( "paths requiring guarantees: {}" ,
120
- bccx. stats. guaranteed_paths) ;
121
- println ! ( "paths requiring loans : {}" ,
122
- make_stat( & bccx, bccx. stats. loaned_paths_same) ) ;
123
- println ! ( "paths requiring imm loans : {}" ,
124
- make_stat( & bccx, bccx. stats. loaned_paths_imm) ) ;
125
- println ! ( "stable paths : {}" ,
126
- make_stat( & bccx, bccx. stats. stable_paths) ) ;
127
- }
128
-
129
- fn make_stat ( bccx : & BorrowckCtxt , stat : usize ) -> String {
130
- let total = bccx. stats . guaranteed_paths as f64 ;
131
- let perc = if total == 0.0 { 0.0 } else { stat as f64 * 100.0 / total } ;
132
- format ! ( "{} ({:.0}%)" , stat, perc)
133
- }
134
110
}
135
111
136
112
fn borrowck_item < ' a , ' tcx > ( this : & mut BorrowckCtxt < ' a , ' tcx > , item : & ' tcx hir:: Item ) {
@@ -245,12 +221,6 @@ pub fn build_borrowck_dataflow_data_for_fn<'a, 'tcx>(
245
221
let mut bccx = BorrowckCtxt {
246
222
tcx : tcx,
247
223
tables : None ,
248
- stats : BorrowStats {
249
- loaned_paths_same : 0 ,
250
- loaned_paths_imm : 0 ,
251
- stable_paths : 0 ,
252
- guaranteed_paths : 0
253
- }
254
224
} ;
255
225
256
226
let dataflow_data = build_borrowck_dataflow_data ( & mut bccx, cfg, body) ;
@@ -266,17 +236,6 @@ pub struct BorrowckCtxt<'a, 'tcx: 'a> {
266
236
// tables for the current thing we are checking; set to
267
237
// Some in `borrowck_fn` and cleared later
268
238
tables : Option < & ' a ty:: TypeckTables < ' tcx > > ,
269
-
270
- // Statistics:
271
- stats : BorrowStats
272
- }
273
-
274
- #[ derive( Clone ) ]
275
- struct BorrowStats {
276
- loaned_paths_same : usize ,
277
- loaned_paths_imm : usize ,
278
- stable_paths : usize ,
279
- guaranteed_paths : usize
280
239
}
281
240
282
241
///////////////////////////////////////////////////////////////////////////
0 commit comments