File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 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(
12781278 let header_hi = struct_parts. ident . span . hi ( ) ;
12791279 let body_lo = if let Some ( generics) = struct_parts. generics {
12801280 // 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 ( ) ) ;
12821282 context. snippet_provider . span_after ( span, "{" )
12831283 } else {
12841284 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