File tree Expand file tree Collapse file tree 3 files changed +91
-3
lines changed Expand file tree Collapse file tree 3 files changed +91
-3
lines changed Original file line number Diff line number Diff line change @@ -558,9 +558,13 @@ impl<'a> FmtVisitor<'a> {
558558 // make a span that starts right after `enum Foo`
559559 mk_sp ( ident. span . hi ( ) , body_start) ,
560560 last_line_width ( & enum_header) ,
561- )
562- . unwrap ( ) ;
563- self . push_str ( & generics_str) ;
561+ ) ;
562+
563+ if let Some ( generics_str) = generics_str {
564+ self . push_str ( & generics_str) ;
565+ } else {
566+ self . push_str ( self . snippet ( mk_sp ( ident. span . hi ( ) , body_start) ) ) ;
567+ }
564568
565569 self . last_pos = body_start;
566570
Original file line number Diff line number Diff line change 1+ // rustfmt-style_edition: 2024
2+ enum En4 < ' x1 , ' x2 , T : Tr1 < As1 : > > {
3+ V0 ,
4+ V1 ,
5+ }
6+
7+ enum _En5 < ' x1 , ' x2 , T : Tr1 < As1 : > > {
8+ _V0,
9+ _V1,
10+ }
11+
12+ enum En6
13+ where
14+ T : Tr1 < En2 < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S > > > > > > > > > > > > > > > > > > > > > > > > ,
15+ {
16+ V0 ,
17+ V1 ,
18+ V2 ,
19+ V3 ,
20+ }
21+
22+ enum _En7
23+ where
24+ T : ,
25+ {
26+ V0 ,
27+ V1 ,
28+ }
29+
30+ fn _make_en7 ( )
31+ where
32+ T : ,
33+ {
34+
35+ }
36+
37+ enum EnSelf < T > where Self : Tr1 < As1 : > {
38+ V0 ( T ) ,
39+ V1 ,
40+ V2 ,
41+ }
Original file line number Diff line number Diff line change 1+ // rustfmt-style_edition: 2024
2+ enum En4 < ' x1 , ' x2 , T : Tr1 < As1 : > > {
3+ V0 ,
4+ V1 ,
5+ }
6+
7+ enum _En5 < ' x1 , ' x2 , T : Tr1 < As1 : > > {
8+ _V0,
9+ _V1,
10+ }
11+
12+ enum En6
13+ where
14+ T : Tr1 < En2 < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S < S > > > > > > > > > > > > > > > > > > > > > > > > ,
15+ {
16+ V0 ,
17+ V1 ,
18+ V2 ,
19+ V3 ,
20+ }
21+
22+ enum _En7
23+ where
24+ T : ,
25+ {
26+ V0 ,
27+ V1 ,
28+ }
29+
30+ fn _make_en7 ( )
31+ where
32+ T : ,
33+ {
34+ }
35+
36+ enum EnSelf < T >
37+ where
38+ Self : Tr1 < As1 : > ,
39+ {
40+ V0 ( T ) ,
41+ V1 ,
42+ V2 ,
43+ }
You can’t perform that action at this time.
0 commit comments