@@ -13,9 +13,9 @@ use rustc_metadata::cstore::LoadedMacro;
1313use rustc:: ty;
1414use rustc:: util:: nodemap:: FxHashSet ;
1515
16- use core:: { DocContext , DocAccessLevels } ;
17- use doctree;
18- use clean:: {
16+ use crate :: core:: { DocContext , DocAccessLevels } ;
17+ use crate :: doctree;
18+ use crate :: clean:: {
1919 self ,
2020 GetDefId ,
2121 ToSource ,
@@ -35,7 +35,12 @@ use super::Clean;
3535///
3636/// The returned value is `None` if the definition could not be inlined,
3737/// and `Some` of a vector of items if it was successfully expanded.
38- pub fn try_inline ( cx : & DocContext , def : Def , name : ast:: Name , visited : & mut FxHashSet < DefId > )
38+ pub fn try_inline (
39+ cx : & DocContext < ' _ , ' _ , ' _ > ,
40+ def : Def ,
41+ name : ast:: Name ,
42+ visited : & mut FxHashSet < DefId >
43+ )
3944 -> Option < Vec < clean:: Item > > {
4045 let did = if let Some ( did) = def. opt_def_id ( ) {
4146 did
@@ -124,7 +129,7 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
124129 Some ( ret)
125130}
126131
127- pub fn try_inline_glob ( cx : & DocContext , def : Def , visited : & mut FxHashSet < DefId > )
132+ pub fn try_inline_glob ( cx : & DocContext < ' _ , ' _ , ' _ > , def : Def , visited : & mut FxHashSet < DefId > )
128133 -> Option < Vec < clean:: Item > >
129134{
130135 if def == Def :: Err { return None }
@@ -141,15 +146,15 @@ pub fn try_inline_glob(cx: &DocContext, def: Def, visited: &mut FxHashSet<DefId>
141146 }
142147}
143148
144- pub fn load_attrs ( cx : & DocContext , did : DefId ) -> clean:: Attributes {
149+ pub fn load_attrs ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Attributes {
145150 cx. tcx . get_attrs ( did) . clean ( cx)
146151}
147152
148153/// Record an external fully qualified name in the external_paths cache.
149154///
150155/// These names are used later on by HTML rendering to generate things like
151156/// source links back to the original item.
152- pub fn record_extern_fqn ( cx : & DocContext , did : DefId , kind : clean:: TypeKind ) {
157+ pub fn record_extern_fqn ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , kind : clean:: TypeKind ) {
153158 let mut crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
154159 if did. is_local ( ) {
155160 crate_name = cx. crate_name . clone ( ) . unwrap_or ( crate_name) ;
@@ -177,7 +182,7 @@ pub fn record_extern_fqn(cx: &DocContext, did: DefId, kind: clean::TypeKind) {
177182 }
178183}
179184
180- pub fn build_external_trait ( cx : & DocContext , did : DefId ) -> clean:: Trait {
185+ pub fn build_external_trait ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Trait {
181186 let auto_trait = cx. tcx . trait_def ( did) . has_auto_impl ;
182187 let trait_items = cx. tcx . associated_items ( did) . map ( |item| item. clean ( cx) ) . collect ( ) ;
183188 let predicates = cx. tcx . predicates_of ( did) ;
@@ -197,7 +202,7 @@ pub fn build_external_trait(cx: &DocContext, did: DefId) -> clean::Trait {
197202 }
198203}
199204
200- fn build_external_function ( cx : & DocContext , did : DefId ) -> clean:: Function {
205+ fn build_external_function ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Function {
201206 let sig = cx. tcx . fn_sig ( did) ;
202207
203208 let constness = if cx. tcx . is_min_const_fn ( did) {
@@ -219,7 +224,7 @@ fn build_external_function(cx: &DocContext, did: DefId) -> clean::Function {
219224 }
220225}
221226
222- fn build_enum ( cx : & DocContext , did : DefId ) -> clean:: Enum {
227+ fn build_enum ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Enum {
223228 let predicates = cx. tcx . predicates_of ( did) ;
224229
225230 clean:: Enum {
@@ -229,7 +234,7 @@ fn build_enum(cx: &DocContext, did: DefId) -> clean::Enum {
229234 }
230235}
231236
232- fn build_struct ( cx : & DocContext , did : DefId ) -> clean:: Struct {
237+ fn build_struct ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Struct {
233238 let predicates = cx. tcx . predicates_of ( did) ;
234239 let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
235240
@@ -245,7 +250,7 @@ fn build_struct(cx: &DocContext, did: DefId) -> clean::Struct {
245250 }
246251}
247252
248- fn build_union ( cx : & DocContext , did : DefId ) -> clean:: Union {
253+ fn build_union ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Union {
249254 let predicates = cx. tcx . predicates_of ( did) ;
250255 let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
251256
@@ -257,7 +262,7 @@ fn build_union(cx: &DocContext, did: DefId) -> clean::Union {
257262 }
258263}
259264
260- fn build_type_alias ( cx : & DocContext , did : DefId ) -> clean:: Typedef {
265+ fn build_type_alias ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Typedef {
261266 let predicates = cx. tcx . predicates_of ( did) ;
262267
263268 clean:: Typedef {
@@ -266,7 +271,7 @@ fn build_type_alias(cx: &DocContext, did: DefId) -> clean::Typedef {
266271 }
267272}
268273
269- pub fn build_impls ( cx : & DocContext , did : DefId ) -> Vec < clean:: Item > {
274+ pub fn build_impls ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> Vec < clean:: Item > {
270275 let tcx = cx. tcx ;
271276 let mut impls = Vec :: new ( ) ;
272277
@@ -277,7 +282,7 @@ pub fn build_impls(cx: &DocContext, did: DefId) -> Vec<clean::Item> {
277282 impls
278283}
279284
280- pub fn build_impl ( cx : & DocContext , did : DefId , ret : & mut Vec < clean:: Item > ) {
285+ pub fn build_impl ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , ret : & mut Vec < clean:: Item > ) {
281286 if !cx. renderinfo . borrow_mut ( ) . inlined . insert ( did) {
282287 return
283288 }
@@ -387,15 +392,19 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
387392 } ) ;
388393}
389394
390- fn build_module ( cx : & DocContext , did : DefId , visited : & mut FxHashSet < DefId > ) -> clean:: Module {
395+ fn build_module (
396+ cx : & DocContext < ' _ , ' _ , ' _ > ,
397+ did : DefId ,
398+ visited : & mut FxHashSet < DefId >
399+ ) -> clean:: Module {
391400 let mut items = Vec :: new ( ) ;
392401 fill_in ( cx, did, & mut items, visited) ;
393402 return clean:: Module {
394403 items,
395404 is_crate : false ,
396405 } ;
397406
398- fn fill_in ( cx : & DocContext , did : DefId , items : & mut Vec < clean:: Item > ,
407+ fn fill_in ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , items : & mut Vec < clean:: Item > ,
399408 visited : & mut FxHashSet < DefId > ) {
400409 // If we're re-exporting a re-export it may actually re-export something in
401410 // two namespaces, so the target may be listed twice. Make sure we only
@@ -412,30 +421,30 @@ fn build_module(cx: &DocContext, did: DefId, visited: &mut FxHashSet<DefId>) ->
412421 }
413422}
414423
415- pub fn print_inlined_const ( cx : & DocContext , did : DefId ) -> String {
424+ pub fn print_inlined_const ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> String {
416425 if let Some ( node_id) = cx. tcx . hir ( ) . as_local_node_id ( did) {
417426 cx. tcx . hir ( ) . node_to_pretty_string ( node_id)
418427 } else {
419428 cx. tcx . rendered_const ( did)
420429 }
421430}
422431
423- fn build_const ( cx : & DocContext , did : DefId ) -> clean:: Constant {
432+ fn build_const ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Constant {
424433 clean:: Constant {
425434 type_ : cx. tcx . type_of ( did) . clean ( cx) ,
426435 expr : print_inlined_const ( cx, did)
427436 }
428437}
429438
430- fn build_static ( cx : & DocContext , did : DefId , mutable : bool ) -> clean:: Static {
439+ fn build_static ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , mutable : bool ) -> clean:: Static {
431440 clean:: Static {
432441 type_ : cx. tcx . type_of ( did) . clean ( cx) ,
433442 mutability : if mutable { clean:: Mutable } else { clean:: Immutable } ,
434443 expr : "\n \n \n " . to_string ( ) , // trigger the "[definition]" links
435444 }
436445}
437446
438- fn build_macro ( cx : & DocContext , did : DefId , name : ast:: Name ) -> clean:: ItemEnum {
447+ fn build_macro ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , name : ast:: Name ) -> clean:: ItemEnum {
439448 let imported_from = cx. tcx . original_crate_name ( did. krate ) ;
440449 match cx. cstore . load_macro_untracked ( did, cx. sess ( ) ) {
441450 LoadedMacro :: MacroDef ( def) => {
@@ -537,7 +546,7 @@ fn separate_supertrait_bounds(mut g: clean::Generics)
537546 ( g, ty_bounds)
538547}
539548
540- pub fn record_extern_trait ( cx : & DocContext , did : DefId ) {
549+ pub fn record_extern_trait ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) {
541550 if did. is_local ( ) {
542551 return ;
543552 }
0 commit comments