15
15
// done by the orphan and overlap modules. Then we build up various
16
16
// mappings. That mapping code resides here.
17
17
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 } ;
20
20
use rustc:: ty:: maps:: Providers ;
21
21
22
22
use syntax:: ast;
@@ -113,8 +113,7 @@ pub fn provide(providers: &mut Providers) {
113
113
} ;
114
114
}
115
115
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 ) {
118
117
let impls = tcx. hir . trait_impls ( def_id) ;
119
118
for & impl_id in impls {
120
119
check_impl ( tcx, impl_id) ;
@@ -127,14 +126,14 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
127
126
128
127
pub fn check_coherence < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) {
129
128
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) ;
131
130
}
132
131
133
132
unsafety:: check ( tcx) ;
134
133
orphan:: check ( tcx) ;
135
134
overlap:: check_auto_impls ( tcx) ;
136
135
137
136
// 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 ) ;
140
139
}
0 commit comments