diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2019-01-26 15:06:51 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2019-01-29 21:10:35 +0100 |
| commit | 8d7606078501d4827f39a9b1f9a00536e7fe1f62 (patch) | |
| tree | 6dff090a5d3d56b4f4e679f34a38e7a8f2090b70 | |
| parent | eb8fb5342528907222edbf6fcb06dd624a395ce1 (diff) | |
| download | rust-8d7606078501d4827f39a9b1f9a00536e7fe1f62.tar.gz rust-8d7606078501d4827f39a9b1f9a00536e7fe1f62.zip | |
Add some time statements
| -rw-r--r-- | src/librustc_typeck/coherence/mod.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index 13d24026ba3..853c4c85d3f 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -9,6 +9,7 @@ use hir::def_id::{DefId, LOCAL_CRATE}; use rustc::traits; use rustc::ty::{self, TyCtxt, TypeFoldable}; use rustc::ty::query::Providers; +use rustc::util::common::time; use syntax::ast; @@ -132,7 +133,9 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) { for &impl_id in impls { check_impl_overlap(tcx, impl_id); } - builtin::check_trait(tcx, def_id); + use rustc::util::common::time; + time(tcx.sess, "builtin::check_trait checking", || + builtin::check_trait(tcx, def_id)); } pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { @@ -140,8 +143,8 @@ pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { tcx.ensure().coherent_trait(trait_def_id); } - unsafety::check(tcx); - orphan::check(tcx); + time(tcx.sess, "unsafety checking", || unsafety::check(tcx)); + time(tcx.sess, "orphan checking", || orphan::check(tcx)); // these queries are executed for side-effects (error reporting): tcx.ensure().crate_inherent_impls(LOCAL_CRATE); |
