Skip to content

Commit

Permalink
Add some time statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Jan 29, 2019
1 parent eb8fb53 commit 8d76060
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/librustc_typeck/coherence/mod.rs
Expand Up @@ -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;

Expand Down Expand Up @@ -132,16 +133,18 @@ 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>) {
for &trait_def_id in tcx.hir().krate().trait_impls.keys() {
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);
Expand Down

0 comments on commit 8d76060

Please sign in to comment.