@@ -13,9 +13,9 @@ use rustc_metadata::cstore::LoadedMacro;
13
13
use rustc:: ty;
14
14
use rustc:: util:: nodemap:: FxHashSet ;
15
15
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:: {
19
19
self ,
20
20
GetDefId ,
21
21
ToSource ,
@@ -35,7 +35,7 @@ use super::Clean;
35
35
///
36
36
/// The returned value is `None` if the definition could not be inlined,
37
37
/// 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 > )
39
39
-> Option < Vec < clean:: Item > > {
40
40
let did = if let Some ( did) = def. opt_def_id ( ) {
41
41
did
@@ -124,7 +124,7 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
124
124
Some ( ret)
125
125
}
126
126
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 > )
128
128
-> Option < Vec < clean:: Item > >
129
129
{
130
130
if def == Def :: Err { return None }
@@ -141,15 +141,15 @@ pub fn try_inline_glob(cx: &DocContext, def: Def, visited: &mut FxHashSet<DefId>
141
141
}
142
142
}
143
143
144
- pub fn load_attrs ( cx : & DocContext , did : DefId ) -> clean:: Attributes {
144
+ pub fn load_attrs ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Attributes {
145
145
cx. tcx . get_attrs ( did) . clean ( cx)
146
146
}
147
147
148
148
/// Record an external fully qualified name in the external_paths cache.
149
149
///
150
150
/// These names are used later on by HTML rendering to generate things like
151
151
/// 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 ) {
153
153
let mut crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
154
154
if did. is_local ( ) {
155
155
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) {
177
177
}
178
178
}
179
179
180
- pub fn build_external_trait ( cx : & DocContext , did : DefId ) -> clean:: Trait {
180
+ pub fn build_external_trait ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Trait {
181
181
let auto_trait = cx. tcx . trait_def ( did) . has_auto_impl ;
182
182
let trait_items = cx. tcx . associated_items ( did) . map ( |item| item. clean ( cx) ) . collect ( ) ;
183
183
let predicates = cx. tcx . predicates_of ( did) ;
@@ -197,7 +197,7 @@ pub fn build_external_trait(cx: &DocContext, did: DefId) -> clean::Trait {
197
197
}
198
198
}
199
199
200
- fn build_external_function ( cx : & DocContext , did : DefId ) -> clean:: Function {
200
+ fn build_external_function ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Function {
201
201
let sig = cx. tcx . fn_sig ( did) ;
202
202
203
203
let constness = if cx. tcx . is_min_const_fn ( did) {
@@ -219,7 +219,7 @@ fn build_external_function(cx: &DocContext, did: DefId) -> clean::Function {
219
219
}
220
220
}
221
221
222
- fn build_enum ( cx : & DocContext , did : DefId ) -> clean:: Enum {
222
+ fn build_enum ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Enum {
223
223
let predicates = cx. tcx . predicates_of ( did) ;
224
224
225
225
clean:: Enum {
@@ -229,7 +229,7 @@ fn build_enum(cx: &DocContext, did: DefId) -> clean::Enum {
229
229
}
230
230
}
231
231
232
- fn build_struct ( cx : & DocContext , did : DefId ) -> clean:: Struct {
232
+ fn build_struct ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Struct {
233
233
let predicates = cx. tcx . predicates_of ( did) ;
234
234
let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
235
235
@@ -245,7 +245,7 @@ fn build_struct(cx: &DocContext, did: DefId) -> clean::Struct {
245
245
}
246
246
}
247
247
248
- fn build_union ( cx : & DocContext , did : DefId ) -> clean:: Union {
248
+ fn build_union ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Union {
249
249
let predicates = cx. tcx . predicates_of ( did) ;
250
250
let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
251
251
@@ -257,7 +257,7 @@ fn build_union(cx: &DocContext, did: DefId) -> clean::Union {
257
257
}
258
258
}
259
259
260
- fn build_type_alias ( cx : & DocContext , did : DefId ) -> clean:: Typedef {
260
+ fn build_type_alias ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Typedef {
261
261
let predicates = cx. tcx . predicates_of ( did) ;
262
262
263
263
clean:: Typedef {
@@ -266,7 +266,7 @@ fn build_type_alias(cx: &DocContext, did: DefId) -> clean::Typedef {
266
266
}
267
267
}
268
268
269
- pub fn build_impls ( cx : & DocContext , did : DefId ) -> Vec < clean:: Item > {
269
+ pub fn build_impls ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> Vec < clean:: Item > {
270
270
let tcx = cx. tcx ;
271
271
let mut impls = Vec :: new ( ) ;
272
272
@@ -277,7 +277,7 @@ pub fn build_impls(cx: &DocContext, did: DefId) -> Vec<clean::Item> {
277
277
impls
278
278
}
279
279
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 > ) {
281
281
if !cx. renderinfo . borrow_mut ( ) . inlined . insert ( did) {
282
282
return
283
283
}
@@ -387,15 +387,15 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
387
387
} ) ;
388
388
}
389
389
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 {
391
391
let mut items = Vec :: new ( ) ;
392
392
fill_in ( cx, did, & mut items, visited) ;
393
393
return clean:: Module {
394
394
items,
395
395
is_crate : false ,
396
396
} ;
397
397
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 > ,
399
399
visited : & mut FxHashSet < DefId > ) {
400
400
// If we're re-exporting a re-export it may actually re-export something in
401
401
// 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>) ->
412
412
}
413
413
}
414
414
415
- pub fn print_inlined_const ( cx : & DocContext , did : DefId ) -> String {
415
+ pub fn print_inlined_const ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> String {
416
416
if let Some ( node_id) = cx. tcx . hir ( ) . as_local_node_id ( did) {
417
417
cx. tcx . hir ( ) . node_to_pretty_string ( node_id)
418
418
} else {
419
419
cx. tcx . rendered_const ( did)
420
420
}
421
421
}
422
422
423
- fn build_const ( cx : & DocContext , did : DefId ) -> clean:: Constant {
423
+ fn build_const ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) -> clean:: Constant {
424
424
clean:: Constant {
425
425
type_ : cx. tcx . type_of ( did) . clean ( cx) ,
426
426
expr : print_inlined_const ( cx, did)
427
427
}
428
428
}
429
429
430
- fn build_static ( cx : & DocContext , did : DefId , mutable : bool ) -> clean:: Static {
430
+ fn build_static ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId , mutable : bool ) -> clean:: Static {
431
431
clean:: Static {
432
432
type_ : cx. tcx . type_of ( did) . clean ( cx) ,
433
433
mutability : if mutable { clean:: Mutable } else { clean:: Immutable } ,
434
434
expr : "\n \n \n " . to_string ( ) , // trigger the "[definition]" links
435
435
}
436
436
}
437
437
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 {
439
439
let imported_from = cx. tcx . original_crate_name ( did. krate ) ;
440
440
match cx. cstore . load_macro_untracked ( did, cx. sess ( ) ) {
441
441
LoadedMacro :: MacroDef ( def) => {
@@ -537,7 +537,7 @@ fn separate_supertrait_bounds(mut g: clean::Generics)
537
537
( g, ty_bounds)
538
538
}
539
539
540
- pub fn record_extern_trait ( cx : & DocContext , did : DefId ) {
540
+ pub fn record_extern_trait ( cx : & DocContext < ' _ , ' _ , ' _ > , did : DefId ) {
541
541
if did. is_local ( ) {
542
542
return ;
543
543
}
0 commit comments