Skip to content

Commit 764e280

Browse files
committed
Add some time statements
1 parent 6c067bb commit 764e280

File tree

1 file changed

+6
-3
lines changed
  • src/librustc_typeck/coherence

1 file changed

+6
-3
lines changed

src/librustc_typeck/coherence/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use hir::def_id::{DefId, LOCAL_CRATE};
99
use rustc::traits;
1010
use rustc::ty::{self, TyCtxt, TypeFoldable};
1111
use rustc::ty::query::Providers;
12+
use rustc::util::common::time;
1213

1314
use syntax::ast;
1415

@@ -132,16 +133,18 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
132133
for &impl_id in impls {
133134
check_impl_overlap(tcx, impl_id);
134135
}
135-
builtin::check_trait(tcx, def_id);
136+
use rustc::util::common::time;
137+
time(tcx.sess, "builtin::check_trait checking", ||
138+
builtin::check_trait(tcx, def_id));
136139
}
137140

138141
pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
139142
for &trait_def_id in tcx.hir().krate().trait_impls.keys() {
140143
tcx.ensure().coherent_trait(trait_def_id);
141144
}
142145

143-
unsafety::check(tcx);
144-
orphan::check(tcx);
146+
time(tcx.sess, "unsafety checking", || unsafety::check(tcx));
147+
time(tcx.sess, "orphan checking", || orphan::check(tcx));
145148

146149
// these queries are executed for side-effects (error reporting):
147150
tcx.ensure().crate_inherent_impls(LOCAL_CRATE);

0 commit comments

Comments
 (0)