1515// done by the orphan and overlap modules. Then we build up various
1616// mappings. That mapping code resides here.
1717
18- use hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE } ;
19- use rustc:: ty:: { TyCtxt , TypeFoldable } ;
18+ use hir:: def_id:: { DefId , LOCAL_CRATE } ;
19+ use rustc:: ty:: { self , TyCtxt , TypeFoldable } ;
2020use rustc:: ty:: maps:: Providers ;
2121
2222use syntax:: ast;
@@ -113,8 +113,7 @@ pub fn provide(providers: &mut Providers) {
113113 } ;
114114}
115115
116- fn coherent_trait < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
117- ( _, def_id) : ( CrateNum , DefId ) ) {
116+ fn coherent_trait < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , def_id : DefId ) {
118117 let impls = tcx. hir . trait_impls ( def_id) ;
119118 for & impl_id in impls {
120119 check_impl ( tcx, impl_id) ;
@@ -127,14 +126,14 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
127126
128127pub fn check_coherence < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) {
129128 for & trait_def_id in tcx. hir . krate ( ) . trait_impls . keys ( ) {
130- tcx . coherent_trait ( ( LOCAL_CRATE , trait_def_id) ) ;
129+ ty :: maps :: queries :: coherent_trait:: ensure ( tcx , trait_def_id) ;
131130 }
132131
133132 unsafety:: check ( tcx) ;
134133 orphan:: check ( tcx) ;
135134 overlap:: check_auto_impls ( tcx) ;
136135
137136 // these queries are executed for side-effects (error reporting):
138- tcx . crate_inherent_impls ( LOCAL_CRATE ) ;
139- tcx . crate_inherent_impls_overlap_check ( LOCAL_CRATE ) ;
137+ ty :: maps :: queries :: crate_inherent_impls:: ensure ( tcx , LOCAL_CRATE ) ;
138+ ty :: maps :: queries :: crate_inherent_impls_overlap_check:: ensure ( tcx , LOCAL_CRATE ) ;
140139}
0 commit comments