@@ -717,9 +717,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
717717 err. multipart_suggestion (
718718 "consider removing this semicolon and boxing the expressions" ,
719719 vec ! [
720- ( prior_arm. shrink_to_lo( ) , "box (" . to_string( ) ) ,
720+ ( prior_arm. shrink_to_lo( ) , "Box::new (" . to_string( ) ) ,
721721 ( prior_arm. shrink_to_hi( ) , ")" . to_string( ) ) ,
722- ( arm_span. shrink_to_lo( ) , "box (" . to_string( ) ) ,
722+ ( arm_span. shrink_to_lo( ) , "Box::new (" . to_string( ) ) ,
723723 ( arm_span. shrink_to_hi( ) , ")" . to_string( ) ) ,
724724 ( sp, String :: new( ) ) ,
725725 ] ,
@@ -767,9 +767,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
767767 err. multipart_suggestion (
768768 "consider removing this semicolon and boxing the expression" ,
769769 vec ! [
770- ( then. shrink_to_lo( ) , "box (" . to_string( ) ) ,
770+ ( then. shrink_to_lo( ) , "Box::new (" . to_string( ) ) ,
771771 ( then. shrink_to_hi( ) , ")" . to_string( ) ) ,
772- ( else_sp. shrink_to_lo( ) , "box (" . to_string( ) ) ,
772+ ( else_sp. shrink_to_lo( ) , "Box::new (" . to_string( ) ) ,
773773 ( else_sp. shrink_to_hi( ) , ")" . to_string( ) ) ,
774774 ( sp, String :: new( ) ) ,
775775 ] ,
@@ -812,8 +812,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
812812 ) ;
813813 let sugg = arm_spans
814814 . flat_map ( |sp| {
815- vec ! [ ( sp. shrink_to_lo( ) , "box (" . to_string( ) ) , ( sp. shrink_to_hi( ) , ")" . to_string( ) ) ]
816- . into_iter ( )
815+ vec ! [
816+ ( sp. shrink_to_lo( ) , "Box::new(" . to_string( ) ) ,
817+ ( sp. shrink_to_hi( ) , ")" . to_string( ) ) ,
818+ ]
819+ . into_iter ( )
817820 } )
818821 . collect :: < Vec < _ > > ( ) ;
819822 err. multipart_suggestion (
0 commit comments