File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1388,7 +1388,12 @@ pub(crate) fn format_struct_struct(
13881388 result. push_str ( & header_str) ;
13891389
13901390 let header_hi = struct_parts. ident . span . hi ( ) ;
1391- let body_lo = context. snippet_provider . span_after_last ( span, "{" ) ;
1391+ let after_generics_span = struct_parts. generics . map_or ( span, |generics| {
1392+ mk_sp ( generics. where_clause . span . hi ( ) , span. hi ( ) )
1393+ } ) ;
1394+ let body_lo = context
1395+ . snippet_provider
1396+ . span_after ( after_generics_span, "{" ) ;
13921397
13931398 let generics_str = match struct_parts. generics {
13941399 Some ( g) => format_generics (
Original file line number Diff line number Diff line change 1+ struct x{/** */#[x="{"]x:x}
Original file line number Diff line number Diff line change 1+ struct x {
2+ /** */
3+ #[x = "{"]
4+ x: x,
5+ }
You can’t perform that action at this time.
0 commit comments