From 8d7606078501d4827f39a9b1f9a00536e7fe1f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Sat, 26 Jan 2019 15:06:51 +0100 Subject: [PATCH] Add some time statements --- src/librustc_typeck/coherence/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index 13d24026ba3b..853c4c85d3f3 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);