// mappings. That mapping code resides here.
use hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
-use rustc::ty::{self, TyCtxt, TypeFoldable};
+use rustc::ty::{TyCtxt, TypeFoldable};
use rustc::ty::maps::Providers;
-use rustc::dep_graph::DepNode;
use syntax::ast;
-use syntax_pos::DUMMY_SP;
mod builtin;
mod inherent_impls;
}
enforce_trait_manually_implementable(tcx, impl_def_id, trait_ref.def_id);
- let trait_def = tcx.lookup_trait_def(trait_ref.def_id);
- trait_def.record_local_impl(tcx, impl_def_id, trait_ref);
}
}
span,
E0322,
"explicit impls for the `Sized` trait are not permitted")
- .span_label(span, &format!("impl of 'Sized' not allowed"))
+ .span_label(span, "impl of 'Sized' not allowed")
.emit();
return;
}
fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
(_, def_id): (CrateNum, DefId)) {
- tcx.populate_implementations_for_trait_if_necessary(def_id);
-
let impls = tcx.hir.trait_impls(def_id);
for &impl_id in impls {
check_impl(tcx, impl_id);
}
pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
- let _task = tcx.dep_graph.in_task(DepNode::Coherence);
for &trait_def_id in tcx.hir.krate().trait_impls.keys() {
- ty::queries::coherent_trait::get(tcx, DUMMY_SP, (LOCAL_CRATE, trait_def_id));
+ tcx.coherent_trait((LOCAL_CRATE, trait_def_id));
}
unsafety::check(tcx);
overlap::check_default_impls(tcx);
// these queries are executed for side-effects (error reporting):
- ty::queries::crate_inherent_impls::get(tcx, DUMMY_SP, LOCAL_CRATE);
- ty::queries::crate_inherent_impls_overlap_check::get(tcx, DUMMY_SP, LOCAL_CRATE);
+ tcx.crate_inherent_impls(LOCAL_CRATE);
+ tcx.crate_inherent_impls_overlap_check(LOCAL_CRATE);
}