File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1165,10 +1165,10 @@ pub(crate) fn format_trait(
1165
1165
result. push_str ( & generics_str) ;
1166
1166
1167
1167
// FIXME(#2055): rustfmt fails to format when there are comments between trait bounds.
1168
+ // Retrieve *unnormalized* ident (See #6069)
1169
+ let source_ident = context. snippet ( item. ident . span ) ;
1168
1170
if !bounds. is_empty ( ) {
1169
- let ident_hi = context
1170
- . snippet_provider
1171
- . span_after ( item. span , item. ident . as_str ( ) ) ;
1171
+ let ident_hi = context. snippet_provider . span_after ( item. span , source_ident) ;
1172
1172
let bound_hi = bounds. last ( ) . unwrap ( ) . span ( ) . hi ( ) ;
1173
1173
let snippet = context. snippet ( mk_sp ( ident_hi, bound_hi) ) ;
1174
1174
if contains_comment ( snippet) {
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ fn rustfmt_emits_error_on_line_overflow_true() {
176
176
#[ test]
177
177
#[ allow( non_snake_case) ]
178
178
fn dont_emit_ICE ( ) {
179
- let files = [ "tests/target/issue_5728.rs" , "tests/target/issue_5729.rs" ] ;
179
+ let files = [ "tests/target/issue_5728.rs" , "tests/target/issue_5729.rs" , "tests/target/issue_6069.rs" ] ;
180
180
181
181
for file in files {
182
182
let args = [ file] ;
Original file line number Diff line number Diff line change
1
+ trait Foó : Bar { }
You can’t perform that action at this time.
0 commit comments