@@ -266,15 +266,15 @@ fn clean_poly_trait_ref_with_constraints<'tcx>(
266266 )
267267}
268268
269- fn clean_lifetime < ' tcx > ( lifetime : & hir:: Lifetime , cx : & mut DocContext < ' tcx > ) -> Lifetime {
269+ fn clean_lifetime ( lifetime : & hir:: Lifetime , cx : & mut DocContext < ' _ > ) -> Lifetime {
270270 if let Some (
271271 rbv:: ResolvedArg :: EarlyBound ( did)
272272 | rbv:: ResolvedArg :: LateBound ( _, _, did)
273273 | rbv:: ResolvedArg :: Free ( _, did) ,
274274 ) = cx. tcx . named_bound_var ( lifetime. hir_id )
275275 && let Some ( lt) = cx. args . get ( & did. to_def_id ( ) ) . and_then ( |arg| arg. as_lt ( ) )
276276 {
277- return lt . clone ( ) ;
277+ return * lt ;
278278 }
279279 Lifetime ( lifetime. ident . name )
280280}
@@ -285,7 +285,7 @@ pub(crate) fn clean_const<'tcx>(
285285) -> ConstantKind {
286286 match & constant. kind {
287287 hir:: ConstArgKind :: Path ( qpath) => {
288- ConstantKind :: Path { path : qpath_to_string ( & qpath) . into ( ) }
288+ ConstantKind :: Path { path : qpath_to_string ( qpath) . into ( ) }
289289 }
290290 hir:: ConstArgKind :: Anon ( anon) => ConstantKind :: Anonymous { body : anon. body } ,
291291 }
@@ -299,7 +299,7 @@ pub(crate) fn clean_middle_const<'tcx>(
299299 ConstantKind :: TyConst { expr : constant. skip_binder ( ) . to_string ( ) . into ( ) }
300300}
301301
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 > {
303303 match * region {
304304 ty:: ReStatic => Some ( Lifetime :: statik ( ) ) ,
305305 _ if !region. has_name ( ) => None ,
@@ -389,8 +389,8 @@ fn clean_poly_trait_predicate<'tcx>(
389389 } )
390390}
391391
392- fn clean_region_outlives_predicate < ' tcx > (
393- pred : ty:: RegionOutlivesPredicate < ' tcx > ,
392+ fn clean_region_outlives_predicate (
393+ pred : ty:: RegionOutlivesPredicate < ' _ > ,
394394) -> Option < WherePredicate > {
395395 let ty:: OutlivesPredicate ( a, b) = pred;
396396
@@ -513,10 +513,10 @@ fn projection_to_path_segment<'tcx>(
513513 }
514514}
515515
516- fn clean_generic_param_def < ' tcx > (
516+ fn clean_generic_param_def (
517517 def : & ty:: GenericParamDef ,
518518 defaults : ParamDefaults ,
519- cx : & mut DocContext < ' tcx > ,
519+ cx : & mut DocContext < ' _ > ,
520520) -> GenericParamDef {
521521 let ( name, kind) = match def. kind {
522522 ty:: GenericParamDefKind :: Lifetime => {
@@ -1303,10 +1303,7 @@ pub(crate) fn clean_impl_item<'tcx>(
13031303 } )
13041304}
13051305
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 {
13101307 let tcx = cx. tcx ;
13111308 let kind = match assoc_item. kind {
13121309 ty:: AssocKind :: Const => {
@@ -1459,7 +1456,7 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
14591456 // which only has one associated type, which is not a GAT, so whatever.
14601457 }
14611458 }
1462- bounds. extend ( mem:: replace ( pred_bounds, Vec :: new ( ) ) ) ;
1459+ bounds. extend ( mem:: take ( pred_bounds) ) ;
14631460 false
14641461 }
14651462 _ => true ,
@@ -1661,7 +1658,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
16611658 expanded
16621659 } else {
16631660 // 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) {
16651662 path
16661663 } else {
16671664 clean_path ( path, cx)
@@ -1796,7 +1793,7 @@ fn maybe_expand_private_type_alias<'tcx>(
17961793 }
17971794
17981795 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) )
18001797 } ) )
18011798}
18021799
@@ -1806,8 +1803,8 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
18061803 match ty. kind {
18071804 TyKind :: Never => Primitive ( PrimitiveType :: Never ) ,
18081805 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) ) } ;
18111808 BorrowedRef { lifetime, mutability : m. mutbl , type_ : Box :: new ( clean_ty ( m. ty , cx) ) }
18121809 }
18131810 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
18431840 TyKind :: Tup ( tys) => Tuple ( tys. iter ( ) . map ( |ty| clean_ty ( ty, cx) ) . collect ( ) ) ,
18441841 TyKind :: OpaqueDef ( item_id, _, _) => {
18451842 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 {
18471844 ImplTrait ( ty. bounds . iter ( ) . filter_map ( |x| clean_generic_bound ( x, cx) ) . collect ( ) )
18481845 } else {
18491846 unreachable ! ( )
18501847 }
18511848 }
18521849 TyKind :: Path ( _) => clean_qpath ( ty, cx) ,
1853- TyKind :: TraitObject ( bounds, ref lifetime, _) => {
1850+ TyKind :: TraitObject ( bounds, lifetime, _) => {
18541851 let bounds = bounds. iter ( ) . map ( |( bound, _) | clean_poly_trait_ref ( bound, cx) ) . collect ( ) ;
18551852 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 } ;
18571854 DynTrait ( bounds, lifetime)
18581855 }
18591856 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
23552352 clean_field_with_def_id ( field. def_id . to_def_id ( ) , field. ident . name , clean_ty ( field. ty , cx) , cx)
23562353}
23572354
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 {
23592356 clean_field_with_def_id (
23602357 field. did ,
23612358 field. name ,
@@ -2378,7 +2375,7 @@ pub(crate) fn clean_field_with_def_id(
23782375 Item :: from_def_id_and_parts ( def_id, Some ( name) , StructFieldItem ( ty) , cx)
23792376}
23802377
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 {
23822379 let discriminant = match variant. discr {
23832380 ty:: VariantDiscr :: Explicit ( def_id) => Some ( Discriminant { expr : None , value : def_id } ) ,
23842381 ty:: VariantDiscr :: Relative ( _) => None ,
@@ -2526,7 +2523,7 @@ fn clean_generic_args<'tcx>(
25262523 . filter_map ( |arg| {
25272524 Some ( match arg {
25282525 hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2529- GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2526+ GenericArg :: Lifetime ( clean_lifetime ( lt, cx) )
25302527 }
25312528 hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
25322529 hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
@@ -2579,11 +2576,11 @@ fn clean_bare_fn_ty<'tcx>(
25792576 BareFunctionDecl { safety : bare_fn. safety , abi : bare_fn. abi , decl, generic_params }
25802577}
25812578
2582- pub ( crate ) fn reexport_chain < ' tcx > (
2583- tcx : TyCtxt < ' tcx > ,
2579+ pub ( crate ) fn reexport_chain (
2580+ tcx : TyCtxt < ' _ > ,
25842581 import_def_id : LocalDefId ,
25852582 target_def_id : DefId ,
2586- ) -> & ' tcx [ Reexport ] {
2583+ ) -> & [ Reexport ] {
25872584 for child in tcx. module_children_local ( tcx. local_parent ( import_def_id) ) {
25882585 if child. res . opt_def_id ( ) == Some ( target_def_id)
25892586 && 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>(
28032800 fields : variant_data. fields ( ) . iter ( ) . map ( |x| clean_field ( x, cx) ) . collect ( ) ,
28042801 } ) ,
28052802 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 ) => {
28072804 let ty_vis = cx. tcx . visibility ( def_id) ;
28082805 MacroItem ( Macro {
28092806 // FIXME this shouldn't be false
@@ -3134,9 +3131,7 @@ fn clean_assoc_item_constraint<'tcx>(
31343131 }
31353132}
31363133
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 > {
31403135 bound_vars
31413136 . into_iter ( )
31423137 . filter_map ( |var| match var {
0 commit comments