File tree 3 files changed +7
-4
lines changed
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1166,9 +1166,9 @@ pub(crate) fn format_trait(
1166
1166
1167
1167
// FIXME(#2055): rustfmt fails to format when there are comments between trait bounds.
1168
1168
if !bounds. is_empty ( ) {
1169
- let ident_hi = context
1170
- . snippet_provider
1171
- . span_after ( item. span , item . ident . as_str ( ) ) ;
1169
+ // Retrieve *unnormalized* ident (See #6069)
1170
+ let source_ident = context . snippet ( item . ident . span ) ;
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
+ // `Foó` as written here ends with ASCII 6F `'o'` followed by `'\u{0301}'` COMBINING ACUTE ACCENT.
2
+ // The compiler normalizes that combination to NFC form, `'\u{00F3}'` LATIN SMALL LETTER O WITH ACUTE.
3
+ trait Foó : Bar { }
You can’t perform that action at this time.
0 commit comments