@@ -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,7 @@ 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 ( cx : & DocContext < ' _ , ' _ , ' _ > , def : Def , name : ast:: Name , visited : & mut FxHashSet < DefId > )
3939 -> Option < Vec < clean:: Item > > {
4040 let did = if let Some ( did) = def. opt_def_id ( ) {
4141 did
@@ -124,7 +124,7 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
124124 Some ( ret)
125125}
126126
127- pub fn try_inline_glob ( cx : & DocContext , def : Def , visited : & mut FxHashSet < DefId > )
127+ pub fn try_inline_glob ( cx : & DocContext < ' _ , ' _ , ' _ > , def : Def , visited : & mut FxHashSet < DefId > )
128128 -> Option < Vec < clean:: Item > >
129129{
130130 if def == Def :: Err { return None }
@@ -141,15 +141,15 @@ pub fn try_inline_glob(cx: &DocContext, def: Def, visited: &mut FxHashSet<DefId>
141141 }
142142}
143143
144- pub fn load_attrs ( cx : & DocContext , did : DefId ) -> clean:: Attributes {
144+ pub fn load_attrs ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Attributes {
145145 cx. tcx . get_attrs ( did) . clean ( cx)
146146}
147147
148148/// Record an external fully qualified name in the external_paths cache.
149149///
150150/// These names are used later on by HTML rendering to generate things like
151151/// source links back to the original item.
152- pub fn record_extern_fqn ( cx : & DocContext , did : DefId , kind : clean:: TypeKind ) {
152+ pub fn record_extern_fqn ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , kind : clean:: TypeKind ) {
153153 let mut crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
154154 if did. is_local ( ) {
155155 crate_name = cx. crate_name . clone ( ) . unwrap_or ( crate_name) ;
@@ -177,7 +177,7 @@ pub fn record_extern_fqn(cx: &DocContext, did: DefId, kind: clean::TypeKind) {
177177 }
178178}
179179
180- pub fn build_external_trait ( cx : & DocContext , did : DefId ) -> clean:: Trait {
180+ pub fn build_external_trait ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Trait {
181181 let auto_trait = cx. tcx . trait_def ( did) . has_auto_impl ;
182182 let trait_items = cx. tcx . associated_items ( did) . map ( |item| item. clean ( cx) ) . collect ( ) ;
183183 let predicates = cx. tcx . predicates_of ( did) ;
@@ -197,7 +197,7 @@ pub fn build_external_trait(cx: &DocContext, did: DefId) -> clean::Trait {
197197 }
198198}
199199
200- fn build_external_function ( cx : & DocContext , did : DefId ) -> clean:: Function {
200+ fn build_external_function ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Function {
201201 let sig = cx. tcx . fn_sig ( did) ;
202202
203203 let constness = if cx. tcx . is_min_const_fn ( did) {
@@ -219,7 +219,7 @@ fn build_external_function(cx: &DocContext, did: DefId) -> clean::Function {
219219 }
220220}
221221
222- fn build_enum ( cx : & DocContext , did : DefId ) -> clean:: Enum {
222+ fn build_enum ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Enum {
223223 let predicates = cx. tcx . predicates_of ( did) ;
224224
225225 clean:: Enum {
@@ -229,7 +229,7 @@ fn build_enum(cx: &DocContext, did: DefId) -> clean::Enum {
229229 }
230230}
231231
232- fn build_struct ( cx : & DocContext , did : DefId ) -> clean:: Struct {
232+ fn build_struct ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Struct {
233233 let predicates = cx. tcx . predicates_of ( did) ;
234234 let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
235235
@@ -245,7 +245,7 @@ fn build_struct(cx: &DocContext, did: DefId) -> clean::Struct {
245245 }
246246}
247247
248- fn build_union ( cx : & DocContext , did : DefId ) -> clean:: Union {
248+ fn build_union ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Union {
249249 let predicates = cx. tcx . predicates_of ( did) ;
250250 let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
251251
@@ -257,7 +257,7 @@ fn build_union(cx: &DocContext, did: DefId) -> clean::Union {
257257 }
258258}
259259
260- fn build_type_alias ( cx : & DocContext , did : DefId ) -> clean:: Typedef {
260+ fn build_type_alias ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Typedef {
261261 let predicates = cx. tcx . predicates_of ( did) ;
262262
263263 clean:: Typedef {
@@ -266,7 +266,7 @@ fn build_type_alias(cx: &DocContext, did: DefId) -> clean::Typedef {
266266 }
267267}
268268
269- pub fn build_impls ( cx : & DocContext , did : DefId ) -> Vec < clean:: Item > {
269+ pub fn build_impls ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> Vec < clean:: Item > {
270270 let tcx = cx. tcx ;
271271 let mut impls = Vec :: new ( ) ;
272272
@@ -277,7 +277,7 @@ pub fn build_impls(cx: &DocContext, did: DefId) -> Vec<clean::Item> {
277277 impls
278278}
279279
280- pub fn build_impl ( cx : & DocContext , did : DefId , ret : & mut Vec < clean:: Item > ) {
280+ pub fn build_impl ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , ret : & mut Vec < clean:: Item > ) {
281281 if !cx. renderinfo . borrow_mut ( ) . inlined . insert ( did) {
282282 return
283283 }
@@ -387,15 +387,15 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
387387 } ) ;
388388}
389389
390- fn build_module ( cx : & DocContext , did : DefId , visited : & mut FxHashSet < DefId > ) -> clean:: Module {
390+ fn build_module ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , visited : & mut FxHashSet < DefId > ) -> clean:: Module {
391391 let mut items = Vec :: new ( ) ;
392392 fill_in ( cx, did, & mut items, visited) ;
393393 return clean:: Module {
394394 items,
395395 is_crate : false ,
396396 } ;
397397
398- fn fill_in ( cx : & DocContext , did : DefId , items : & mut Vec < clean:: Item > ,
398+ fn fill_in ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , items : & mut Vec < clean:: Item > ,
399399 visited : & mut FxHashSet < DefId > ) {
400400 // If we're re-exporting a re-export it may actually re-export something in
401401 // two namespaces, so the target may be listed twice. Make sure we only
@@ -412,30 +412,30 @@ fn build_module(cx: &DocContext, did: DefId, visited: &mut FxHashSet<DefId>) ->
412412 }
413413}
414414
415- pub fn print_inlined_const ( cx : & DocContext , did : DefId ) -> String {
415+ pub fn print_inlined_const ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> String {
416416 if let Some ( node_id) = cx. tcx . hir ( ) . as_local_node_id ( did) {
417417 cx. tcx . hir ( ) . node_to_pretty_string ( node_id)
418418 } else {
419419 cx. tcx . rendered_const ( did)
420420 }
421421}
422422
423- fn build_const ( cx : & DocContext , did : DefId ) -> clean:: Constant {
423+ fn build_const ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Constant {
424424 clean:: Constant {
425425 type_ : cx. tcx . type_of ( did) . clean ( cx) ,
426426 expr : print_inlined_const ( cx, did)
427427 }
428428}
429429
430- fn build_static ( cx : & DocContext , did : DefId , mutable : bool ) -> clean:: Static {
430+ fn build_static ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , mutable : bool ) -> clean:: Static {
431431 clean:: Static {
432432 type_ : cx. tcx . type_of ( did) . clean ( cx) ,
433433 mutability : if mutable { clean:: Mutable } else { clean:: Immutable } ,
434434 expr : "\n \n \n " . to_string ( ) , // trigger the "[definition]" links
435435 }
436436}
437437
438- fn build_macro ( cx : & DocContext , did : DefId , name : ast:: Name ) -> clean:: ItemEnum {
438+ fn build_macro ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , name : ast:: Name ) -> clean:: ItemEnum {
439439 let imported_from = cx. tcx . original_crate_name ( did. krate ) ;
440440 match cx. cstore . load_macro_untracked ( did, cx. sess ( ) ) {
441441 LoadedMacro :: MacroDef ( def) => {
@@ -537,7 +537,7 @@ fn separate_supertrait_bounds(mut g: clean::Generics)
537537 ( g, ty_bounds)
538538}
539539
540- pub fn record_extern_trait ( cx : & DocContext , did : DefId ) {
540+ pub fn record_extern_trait ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) {
541541 if did. is_local ( ) {
542542 return ;
543543 }
0 commit comments