@@ -19,7 +19,7 @@ use rustc_front::hir;
19
19
use rustc:: middle:: cstore:: { self , CrateStore } ;
20
20
use rustc:: middle:: def:: Def ;
21
21
use rustc:: middle:: def_id:: DefId ;
22
- use rustc:: middle:: ty;
22
+ use rustc:: middle:: ty:: { self , TyCtxt } ;
23
23
use rustc:: middle:: subst;
24
24
use rustc:: middle:: stability;
25
25
use rustc:: middle:: const_eval;
@@ -67,7 +67,7 @@ pub fn try_inline(cx: &DocContext, id: ast::NodeId, into: Option<ast::Name>)
67
67
} )
68
68
}
69
69
70
- fn try_inline_def ( cx : & DocContext , tcx : & ty :: ctxt ,
70
+ fn try_inline_def ( cx : & DocContext , tcx : & TyCtxt ,
71
71
def : Def ) -> Option < Vec < clean:: Item > > {
72
72
let mut ret = Vec :: new ( ) ;
73
73
let did = def. def_id ( ) ;
@@ -128,7 +128,7 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
128
128
Some ( ret)
129
129
}
130
130
131
- pub fn load_attrs ( cx : & DocContext , tcx : & ty :: ctxt ,
131
+ pub fn load_attrs ( cx : & DocContext , tcx : & TyCtxt ,
132
132
did : DefId ) -> Vec < clean:: Attribute > {
133
133
tcx. get_attrs ( did) . iter ( ) . map ( |a| a. clean ( cx) ) . collect ( )
134
134
}
@@ -148,7 +148,7 @@ pub fn record_extern_fqn(cx: &DocContext, did: DefId, kind: clean::TypeKind) {
148
148
}
149
149
}
150
150
151
- pub fn build_external_trait ( cx : & DocContext , tcx : & ty :: ctxt ,
151
+ pub fn build_external_trait ( cx : & DocContext , tcx : & TyCtxt ,
152
152
did : DefId ) -> clean:: Trait {
153
153
let def = tcx. lookup_trait_def ( did) ;
154
154
let trait_items = tcx. trait_items ( did) . clean ( cx) ;
@@ -164,7 +164,7 @@ pub fn build_external_trait(cx: &DocContext, tcx: &ty::ctxt,
164
164
}
165
165
}
166
166
167
- fn build_external_function ( cx : & DocContext , tcx : & ty :: ctxt , did : DefId ) -> clean:: Function {
167
+ fn build_external_function ( cx : & DocContext , tcx : & TyCtxt , did : DefId ) -> clean:: Function {
168
168
let t = tcx. lookup_item_type ( did) ;
169
169
let ( decl, style, abi) = match t. ty . sty {
170
170
ty:: TyBareFn ( _, ref f) => ( ( did, & f. sig ) . clean ( cx) , f. unsafety , f. abi ) ,
@@ -187,7 +187,7 @@ fn build_external_function(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean
187
187
}
188
188
}
189
189
190
- fn build_struct ( cx : & DocContext , tcx : & ty :: ctxt , did : DefId ) -> clean:: Struct {
190
+ fn build_struct ( cx : & DocContext , tcx : & TyCtxt , did : DefId ) -> clean:: Struct {
191
191
let t = tcx. lookup_item_type ( did) ;
192
192
let predicates = tcx. lookup_predicates ( did) ;
193
193
let variant = tcx. lookup_adt_def ( did) . struct_variant ( ) ;
@@ -205,7 +205,7 @@ fn build_struct(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean::Struct {
205
205
}
206
206
}
207
207
208
- fn build_type ( cx : & DocContext , tcx : & ty :: ctxt , did : DefId ) -> clean:: ItemEnum {
208
+ fn build_type ( cx : & DocContext , tcx : & TyCtxt , did : DefId ) -> clean:: ItemEnum {
209
209
let t = tcx. lookup_item_type ( did) ;
210
210
let predicates = tcx. lookup_predicates ( did) ;
211
211
match t. ty . sty {
@@ -225,7 +225,7 @@ fn build_type(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean::ItemEnum {
225
225
} , false )
226
226
}
227
227
228
- pub fn build_impls ( cx : & DocContext , tcx : & ty :: ctxt ,
228
+ pub fn build_impls ( cx : & DocContext , tcx : & TyCtxt ,
229
229
did : DefId ) -> Vec < clean:: Item > {
230
230
tcx. populate_inherent_implementations_for_type_if_necessary ( did) ;
231
231
let mut impls = Vec :: new ( ) ;
@@ -252,7 +252,7 @@ pub fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
252
252
populate_impls ( cx, tcx, item. def , & mut impls) ;
253
253
}
254
254
255
- fn populate_impls ( cx : & DocContext , tcx : & ty :: ctxt ,
255
+ fn populate_impls ( cx : & DocContext , tcx : & TyCtxt ,
256
256
def : cstore:: DefLike ,
257
257
impls : & mut Vec < clean:: Item > ) {
258
258
match def {
@@ -276,7 +276,7 @@ pub fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
276
276
}
277
277
278
278
pub fn build_impl ( cx : & DocContext ,
279
- tcx : & ty :: ctxt ,
279
+ tcx : & TyCtxt ,
280
280
did : DefId ,
281
281
ret : & mut Vec < clean:: Item > ) {
282
282
if !cx. inlined . borrow_mut ( ) . as_mut ( ) . unwrap ( ) . insert ( did) {
@@ -442,7 +442,7 @@ fn is_doc_hidden(a: &clean::Attribute) -> bool {
442
442
}
443
443
}
444
444
445
- fn build_module ( cx : & DocContext , tcx : & ty :: ctxt ,
445
+ fn build_module ( cx : & DocContext , tcx : & TyCtxt ,
446
446
did : DefId ) -> clean:: Module {
447
447
let mut items = Vec :: new ( ) ;
448
448
fill_in ( cx, tcx, did, & mut items) ;
@@ -451,7 +451,7 @@ fn build_module(cx: &DocContext, tcx: &ty::ctxt,
451
451
is_crate : false ,
452
452
} ;
453
453
454
- fn fill_in ( cx : & DocContext , tcx : & ty :: ctxt , did : DefId ,
454
+ fn fill_in ( cx : & DocContext , tcx : & TyCtxt , did : DefId ,
455
455
items : & mut Vec < clean:: Item > ) {
456
456
// If we're reexporting a reexport it may actually reexport something in
457
457
// two namespaces, so the target may be listed twice. Make sure we only
@@ -478,7 +478,7 @@ fn build_module(cx: &DocContext, tcx: &ty::ctxt,
478
478
}
479
479
}
480
480
481
- fn build_const ( cx : & DocContext , tcx : & ty :: ctxt ,
481
+ fn build_const ( cx : & DocContext , tcx : & TyCtxt ,
482
482
did : DefId ) -> clean:: Constant {
483
483
use rustc:: middle:: const_eval;
484
484
use rustc_front:: print:: pprust;
@@ -496,7 +496,7 @@ fn build_const(cx: &DocContext, tcx: &ty::ctxt,
496
496
}
497
497
}
498
498
499
- fn build_static ( cx : & DocContext , tcx : & ty :: ctxt ,
499
+ fn build_static ( cx : & DocContext , tcx : & TyCtxt ,
500
500
did : DefId ,
501
501
mutable : bool ) -> clean:: Static {
502
502
clean:: Static {
0 commit comments