Skip to content

Commit 5f5946a

Browse files
committed
remove the borrowck stats
1 parent 252c8d7 commit 5f5946a

File tree

1 file changed

+0
-41
lines changed
  • src/librustc_borrowck/borrowck

1 file changed

+0
-41
lines changed

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -104,33 +104,9 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
104104
let mut bccx = BorrowckCtxt {
105105
tcx: tcx,
106106
tables: None,
107-
stats: BorrowStats {
108-
loaned_paths_same: 0,
109-
loaned_paths_imm: 0,
110-
stable_paths: 0,
111-
guaranteed_paths: 0
112-
}
113107
};
114108

115109
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-
}
134110
}
135111

136112
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>(
245221
let mut bccx = BorrowckCtxt {
246222
tcx: tcx,
247223
tables: None,
248-
stats: BorrowStats {
249-
loaned_paths_same: 0,
250-
loaned_paths_imm: 0,
251-
stable_paths: 0,
252-
guaranteed_paths: 0
253-
}
254224
};
255225

256226
let dataflow_data = build_borrowck_dataflow_data(&mut bccx, cfg, body);
@@ -266,17 +236,6 @@ pub struct BorrowckCtxt<'a, 'tcx: 'a> {
266236
// tables for the current thing we are checking; set to
267237
// Some in `borrowck_fn` and cleared later
268238
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
280239
}
281240

282241
///////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)