@@ -1567,7 +1567,7 @@ fn rewrite_static(
15671567 context. config . space_before_colon ( ) ,
15681568 context. config . space_after_colon ( ) ,
15691569 ) ;
1570- let prefix = format ! (
1570+ let mut prefix = format ! (
15711571 "{}{}{} {}{}{}" ,
15721572 format_visibility( static_parts. vis) ,
15731573 static_parts. defaultness. map_or( "" , format_defaultness) ,
@@ -1579,7 +1579,18 @@ fn rewrite_static(
15791579 // 2 = " =".len()
15801580 let ty_shape =
15811581 Shape :: indented ( offset. block_only ( ) , context. config ) . offset_left ( prefix. len ( ) + 2 ) ?;
1582- let ty_str = static_parts. ty . rewrite ( context, ty_shape) ?;
1582+ let ty_str = match static_parts. ty . rewrite ( context, ty_shape) {
1583+ Some ( ty_str) => ty_str,
1584+ None => {
1585+ if prefix. ends_with ( ' ' ) {
1586+ prefix. pop ( ) ;
1587+ }
1588+ let nested_indent = offset. block_indent ( context. config ) ;
1589+ let nested_shape = Shape :: indented ( nested_indent, context. config ) ;
1590+ let ty_str = static_parts. ty . rewrite ( context, nested_shape) ?;
1591+ format ! ( "\n {}{}" , nested_indent. to_string( context. config) , ty_str)
1592+ }
1593+ } ;
15831594
15841595 if let Some ( expr) = static_parts. expr_opt {
15851596 let lhs = format ! ( "{}{} =" , prefix, ty_str) ;
0 commit comments