@@ -883,8 +883,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
883883 self . tcx. get_diagnostic_item( sym:: unwind_safe_trait) ,
884884 self . tcx. get_diagnostic_item( sym:: ref_unwind_safe_trait) ,
885885 ] ;
886- let auto_traits =
887- vec ! [ "`Clone`" , "`Sync`" , "`Send`" , "`Unpin`" , "`UnwindSafe`" , "`RefUnwindSafe`" ] ;
886+ const AUTO_TRAITS : [ & str ; 6 ] =
887+ [ "`Clone`" , "`Sync`" , "`Send`" , "`Unpin`" , "`UnwindSafe`" , "`RefUnwindSafe`" ] ;
888888
889889 let root_var_min_capture_list = min_captures. and_then ( |m| m. get ( & var_hir_id) ) ?;
890890
@@ -957,7 +957,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
957957 // by the root variable but not by the capture
958958 for ( idx, _) in obligations_should_hold. iter ( ) . enumerate ( ) {
959959 if !obligations_holds_for_capture[ idx] && obligations_should_hold[ idx] {
960- capture_problems. insert ( auto_traits [ idx] ) ;
960+ capture_problems. insert ( AUTO_TRAITS [ idx] ) ;
961961 }
962962 }
963963
@@ -1074,7 +1074,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10741074 min_captures : Option < & ty:: RootVariableMinCaptureList < ' tcx > > ,
10751075 ) -> ( Vec < MigrationDiagnosticInfo > , String ) {
10761076 let Some ( upvars) = self . tcx . upvars_mentioned ( closure_def_id) else {
1077- return ( Vec :: new ( ) , format ! ( "" ) ) ;
1077+ return ( Vec :: new ( ) , String :: new ( ) ) ;
10781078 } ;
10791079
10801080 let mut need_migrations = Vec :: new ( ) ;
0 commit comments