@@ -266,15 +266,15 @@ fn clean_poly_trait_ref_with_constraints<'tcx>(
266
266
)
267
267
}
268
268
269
- fn clean_lifetime < ' tcx > ( lifetime : & hir:: Lifetime , cx : & mut DocContext < ' tcx > ) -> Lifetime {
269
+ fn clean_lifetime ( lifetime : & hir:: Lifetime , cx : & mut DocContext < ' _ > ) -> Lifetime {
270
270
if let Some (
271
271
rbv:: ResolvedArg :: EarlyBound ( did)
272
272
| rbv:: ResolvedArg :: LateBound ( _, _, did)
273
273
| rbv:: ResolvedArg :: Free ( _, did) ,
274
274
) = cx. tcx . named_bound_var ( lifetime. hir_id )
275
275
&& let Some ( lt) = cx. args . get ( & did. to_def_id ( ) ) . and_then ( |arg| arg. as_lt ( ) )
276
276
{
277
- return lt . clone ( ) ;
277
+ return * lt ;
278
278
}
279
279
Lifetime ( lifetime. ident . name )
280
280
}
@@ -285,7 +285,7 @@ pub(crate) fn clean_const<'tcx>(
285
285
) -> ConstantKind {
286
286
match & constant. kind {
287
287
hir:: ConstArgKind :: Path ( qpath) => {
288
- ConstantKind :: Path { path : qpath_to_string ( & qpath) . into ( ) }
288
+ ConstantKind :: Path { path : qpath_to_string ( qpath) . into ( ) }
289
289
}
290
290
hir:: ConstArgKind :: Anon ( anon) => ConstantKind :: Anonymous { body : anon. body } ,
291
291
}
@@ -299,7 +299,7 @@ pub(crate) fn clean_middle_const<'tcx>(
299
299
ConstantKind :: TyConst { expr : constant. skip_binder ( ) . to_string ( ) . into ( ) }
300
300
}
301
301
302
- pub ( crate ) fn clean_middle_region < ' tcx > ( region : ty:: Region < ' tcx > ) -> Option < Lifetime > {
302
+ pub ( crate ) fn clean_middle_region ( region : ty:: Region < ' _ > ) -> Option < Lifetime > {
303
303
match * region {
304
304
ty:: ReStatic => Some ( Lifetime :: statik ( ) ) ,
305
305
_ if !region. has_name ( ) => None ,
@@ -389,8 +389,8 @@ fn clean_poly_trait_predicate<'tcx>(
389
389
} )
390
390
}
391
391
392
- fn clean_region_outlives_predicate < ' tcx > (
393
- pred : ty:: RegionOutlivesPredicate < ' tcx > ,
392
+ fn clean_region_outlives_predicate (
393
+ pred : ty:: RegionOutlivesPredicate < ' _ > ,
394
394
) -> Option < WherePredicate > {
395
395
let ty:: OutlivesPredicate ( a, b) = pred;
396
396
@@ -513,10 +513,10 @@ fn projection_to_path_segment<'tcx>(
513
513
}
514
514
}
515
515
516
- fn clean_generic_param_def < ' tcx > (
516
+ fn clean_generic_param_def (
517
517
def : & ty:: GenericParamDef ,
518
518
defaults : ParamDefaults ,
519
- cx : & mut DocContext < ' tcx > ,
519
+ cx : & mut DocContext < ' _ > ,
520
520
) -> GenericParamDef {
521
521
let ( name, kind) = match def. kind {
522
522
ty:: GenericParamDefKind :: Lifetime => {
@@ -1303,10 +1303,7 @@ pub(crate) fn clean_impl_item<'tcx>(
1303
1303
} )
1304
1304
}
1305
1305
1306
- pub ( crate ) fn clean_middle_assoc_item < ' tcx > (
1307
- assoc_item : & ty:: AssocItem ,
1308
- cx : & mut DocContext < ' tcx > ,
1309
- ) -> Item {
1306
+ pub ( crate ) fn clean_middle_assoc_item ( assoc_item : & ty:: AssocItem , cx : & mut DocContext < ' _ > ) -> Item {
1310
1307
let tcx = cx. tcx ;
1311
1308
let kind = match assoc_item. kind {
1312
1309
ty:: AssocKind :: Const => {
@@ -1459,7 +1456,7 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
1459
1456
// which only has one associated type, which is not a GAT, so whatever.
1460
1457
}
1461
1458
}
1462
- bounds. extend ( mem:: replace ( pred_bounds, Vec :: new ( ) ) ) ;
1459
+ bounds. extend ( mem:: take ( pred_bounds) ) ;
1463
1460
false
1464
1461
}
1465
1462
_ => true ,
@@ -1661,7 +1658,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1661
1658
expanded
1662
1659
} else {
1663
1660
// First we check if it's a private re-export.
1664
- let path = if let Some ( path) = first_non_private ( cx, hir_id, & path) {
1661
+ let path = if let Some ( path) = first_non_private ( cx, hir_id, path) {
1665
1662
path
1666
1663
} else {
1667
1664
clean_path ( path, cx)
@@ -1796,7 +1793,7 @@ fn maybe_expand_private_type_alias<'tcx>(
1796
1793
}
1797
1794
1798
1795
Some ( cx. enter_alias ( args, def_id. to_def_id ( ) , |cx| {
1799
- cx. with_param_env ( def_id. to_def_id ( ) , |cx| clean_ty ( & ty, cx) )
1796
+ cx. with_param_env ( def_id. to_def_id ( ) , |cx| clean_ty ( ty, cx) )
1800
1797
} ) )
1801
1798
}
1802
1799
@@ -1806,8 +1803,8 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
1806
1803
match ty. kind {
1807
1804
TyKind :: Never => Primitive ( PrimitiveType :: Never ) ,
1808
1805
TyKind :: Ptr ( ref m) => RawPointer ( m. mutbl , Box :: new ( clean_ty ( m. ty , cx) ) ) ,
1809
- TyKind :: Ref ( ref l, ref m) => {
1810
- let lifetime = if l. is_anonymous ( ) { None } else { Some ( clean_lifetime ( * l, cx) ) } ;
1806
+ TyKind :: Ref ( l, ref m) => {
1807
+ let lifetime = if l. is_anonymous ( ) { None } else { Some ( clean_lifetime ( l, cx) ) } ;
1811
1808
BorrowedRef { lifetime, mutability : m. mutbl , type_ : Box :: new ( clean_ty ( m. ty , cx) ) }
1812
1809
}
1813
1810
TyKind :: Slice ( ty) => Slice ( Box :: new ( clean_ty ( ty, cx) ) ) ,
@@ -1843,17 +1840,17 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
1843
1840
TyKind :: Tup ( tys) => Tuple ( tys. iter ( ) . map ( |ty| clean_ty ( ty, cx) ) . collect ( ) ) ,
1844
1841
TyKind :: OpaqueDef ( item_id, _, _) => {
1845
1842
let item = cx. tcx . hir ( ) . item ( item_id) ;
1846
- if let hir:: ItemKind :: OpaqueTy ( ref ty) = item. kind {
1843
+ if let hir:: ItemKind :: OpaqueTy ( ty) = item. kind {
1847
1844
ImplTrait ( ty. bounds . iter ( ) . filter_map ( |x| clean_generic_bound ( x, cx) ) . collect ( ) )
1848
1845
} else {
1849
1846
unreachable ! ( )
1850
1847
}
1851
1848
}
1852
1849
TyKind :: Path ( _) => clean_qpath ( ty, cx) ,
1853
- TyKind :: TraitObject ( bounds, ref lifetime, _) => {
1850
+ TyKind :: TraitObject ( bounds, lifetime, _) => {
1854
1851
let bounds = bounds. iter ( ) . map ( |( bound, _) | clean_poly_trait_ref ( bound, cx) ) . collect ( ) ;
1855
1852
let lifetime =
1856
- if !lifetime. is_elided ( ) { Some ( clean_lifetime ( * lifetime, cx) ) } else { None } ;
1853
+ if !lifetime. is_elided ( ) { Some ( clean_lifetime ( lifetime, cx) ) } else { None } ;
1857
1854
DynTrait ( bounds, lifetime)
1858
1855
}
1859
1856
TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( clean_bare_fn_ty ( barefn, cx) ) ) ,
@@ -2355,7 +2352,7 @@ pub(crate) fn clean_field<'tcx>(field: &hir::FieldDef<'tcx>, cx: &mut DocContext
2355
2352
clean_field_with_def_id ( field. def_id . to_def_id ( ) , field. ident . name , clean_ty ( field. ty , cx) , cx)
2356
2353
}
2357
2354
2358
- pub ( crate ) fn clean_middle_field < ' tcx > ( field : & ty:: FieldDef , cx : & mut DocContext < ' tcx > ) -> Item {
2355
+ pub ( crate ) fn clean_middle_field ( field : & ty:: FieldDef , cx : & mut DocContext < ' _ > ) -> Item {
2359
2356
clean_field_with_def_id (
2360
2357
field. did ,
2361
2358
field. name ,
@@ -2378,7 +2375,7 @@ pub(crate) fn clean_field_with_def_id(
2378
2375
Item :: from_def_id_and_parts ( def_id, Some ( name) , StructFieldItem ( ty) , cx)
2379
2376
}
2380
2377
2381
- pub ( crate ) fn clean_variant_def < ' tcx > ( variant : & ty:: VariantDef , cx : & mut DocContext < ' tcx > ) -> Item {
2378
+ pub ( crate ) fn clean_variant_def ( variant : & ty:: VariantDef , cx : & mut DocContext < ' _ > ) -> Item {
2382
2379
let discriminant = match variant. discr {
2383
2380
ty:: VariantDiscr :: Explicit ( def_id) => Some ( Discriminant { expr : None , value : def_id } ) ,
2384
2381
ty:: VariantDiscr :: Relative ( _) => None ,
@@ -2526,7 +2523,7 @@ fn clean_generic_args<'tcx>(
2526
2523
. filter_map ( |arg| {
2527
2524
Some ( match arg {
2528
2525
hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2529
- GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2526
+ GenericArg :: Lifetime ( clean_lifetime ( lt, cx) )
2530
2527
}
2531
2528
hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2532
2529
hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
@@ -2579,11 +2576,11 @@ fn clean_bare_fn_ty<'tcx>(
2579
2576
BareFunctionDecl { safety : bare_fn. safety , abi : bare_fn. abi , decl, generic_params }
2580
2577
}
2581
2578
2582
- pub ( crate ) fn reexport_chain < ' tcx > (
2583
- tcx : TyCtxt < ' tcx > ,
2579
+ pub ( crate ) fn reexport_chain (
2580
+ tcx : TyCtxt < ' _ > ,
2584
2581
import_def_id : LocalDefId ,
2585
2582
target_def_id : DefId ,
2586
- ) -> & ' tcx [ Reexport ] {
2583
+ ) -> & [ Reexport ] {
2587
2584
for child in tcx. module_children_local ( tcx. local_parent ( import_def_id) ) {
2588
2585
if child. res . opt_def_id ( ) == Some ( target_def_id)
2589
2586
&& child. reexport_chain . first ( ) . and_then ( |r| r. id ( ) ) == Some ( import_def_id. to_def_id ( ) )
@@ -2803,7 +2800,7 @@ fn clean_maybe_renamed_item<'tcx>(
2803
2800
fields : variant_data. fields ( ) . iter ( ) . map ( |x| clean_field ( x, cx) ) . collect ( ) ,
2804
2801
} ) ,
2805
2802
ItemKind :: Impl ( impl_) => return clean_impl ( impl_, item. owner_id . def_id , cx) ,
2806
- ItemKind :: Macro ( ref macro_def, MacroKind :: Bang ) => {
2803
+ ItemKind :: Macro ( macro_def, MacroKind :: Bang ) => {
2807
2804
let ty_vis = cx. tcx . visibility ( def_id) ;
2808
2805
MacroItem ( Macro {
2809
2806
// FIXME this shouldn't be false
@@ -3134,9 +3131,7 @@ fn clean_assoc_item_constraint<'tcx>(
3134
3131
}
3135
3132
}
3136
3133
3137
- fn clean_bound_vars < ' tcx > (
3138
- bound_vars : & ' tcx ty:: List < ty:: BoundVariableKind > ,
3139
- ) -> Vec < GenericParamDef > {
3134
+ fn clean_bound_vars ( bound_vars : & ty:: List < ty:: BoundVariableKind > ) -> Vec < GenericParamDef > {
3140
3135
bound_vars
3141
3136
. into_iter ( )
3142
3137
. filter_map ( |var| match var {
0 commit comments