File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -1278,7 +1278,7 @@ pub(crate) fn format_struct_struct(
1278
1278
let header_hi = struct_parts. ident . span . hi ( ) ;
1279
1279
let body_lo = if let Some ( generics) = struct_parts. generics {
1280
1280
// Adjust the span to start at the end of the generic arguments before searching for the '{'
1281
- let span = span. with_lo ( generics. span . hi ( ) ) ;
1281
+ let span = span. with_lo ( generics. where_clause . span . hi ( ) ) ;
1282
1282
context. snippet_provider . span_after ( span, "{" )
1283
1283
} else {
1284
1284
context. snippet_provider . span_after ( span, "{" )
Original file line number Diff line number Diff line change
1
+ struct S < const C : usize >
2
+ where
3
+ [ ( ) ; { num_slots ! ( C ) } ] : , {
4
+ /* An asterisk-based, or a double-slash-prefixed, comment here is
5
+ required to trigger the fmt bug.
6
+
7
+ A single-line triple-slash-prefixed comment (with a field following it) is not enough - it will not trigger the fmt bug.
8
+
9
+ Side note: If you have a combination of two, or all three of the
10
+ above mentioned types of comments here, some of them disappear
11
+ after `cargo fmt`.
12
+
13
+ The bug gets triggered even if a field definition following the
14
+ (asterisk-based, or a double-slash-prefixed) comment, too.
15
+ */
16
+ }
You can’t perform that action at this time.
0 commit comments