@@ -498,7 +498,7 @@ fn clean_generic_param_def<'tcx>(
498498) -> GenericParamDef {
499499 let ( name, kind) = match def. kind {
500500 ty:: GenericParamDefKind :: Lifetime => {
501- ( def. name , GenericParamDefKind :: Lifetime { outlives : vec ! [ ] } )
501+ ( def. name , GenericParamDefKind :: Lifetime { outlives : ThinVec :: new ( ) } )
502502 }
503503 ty:: GenericParamDefKind :: Type { has_default, synthetic, .. } => {
504504 let default = if has_default {
@@ -515,7 +515,7 @@ fn clean_generic_param_def<'tcx>(
515515 def. name ,
516516 GenericParamDefKind :: Type {
517517 did : def. def_id ,
518- bounds : vec ! [ ] , // These are filled in from the where-clauses.
518+ bounds : ThinVec :: new ( ) , // These are filled in from the where-clauses.
519519 default : default. map ( Box :: new) ,
520520 synthetic,
521521 } ,
@@ -567,7 +567,7 @@ fn clean_generic_param<'tcx>(
567567 } )
568568 . collect ( )
569569 } else {
570- Vec :: new ( )
570+ ThinVec :: new ( )
571571 } ;
572572 ( param. name . ident ( ) . name , GenericParamDefKind :: Lifetime { outlives } )
573573 }
@@ -580,7 +580,7 @@ fn clean_generic_param<'tcx>(
580580 . filter_map ( |x| clean_generic_bound ( x, cx) )
581581 . collect ( )
582582 } else {
583- Vec :: new ( )
583+ ThinVec :: new ( )
584584 } ;
585585 (
586586 param. name . ident ( ) . name ,
@@ -636,7 +636,7 @@ pub(crate) fn clean_generics<'tcx>(
636636 match param. kind {
637637 GenericParamDefKind :: Lifetime { .. } => unreachable ! ( ) ,
638638 GenericParamDefKind :: Type { did, ref bounds, .. } => {
639- cx. impl_trait_bounds . insert ( did. into ( ) , bounds. clone ( ) ) ;
639+ cx. impl_trait_bounds . insert ( did. into ( ) , bounds. to_vec ( ) ) ;
640640 }
641641 GenericParamDefKind :: Const { .. } => unreachable ! ( ) ,
642642 }
@@ -3146,7 +3146,7 @@ fn clean_bound_vars<'tcx>(
31463146 name,
31473147 kind : GenericParamDefKind :: Type {
31483148 did,
3149- bounds : Vec :: new ( ) ,
3149+ bounds : ThinVec :: new ( ) ,
31503150 default : None ,
31513151 synthetic : false ,
31523152 } ,
0 commit comments