@@ -1191,16 +1191,26 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1191
1191
// | |
1192
1192
// | elided as they were the same
1193
1193
// not elided, they were different, but irrelevant
1194
+ //
1195
+ // For bound lifetimes, keep the names of the lifetimes,
1196
+ // even if they are the same so that it's clear what's happening
1197
+ // if we have something like
1198
+ //
1199
+ // for<'r, 's> fn(Inv<'r>, Inv<'s>)
1200
+ // for<'r> fn(Inv<'r>, Inv<'r>)
1194
1201
let lifetimes = sub1. regions ( ) . zip ( sub2. regions ( ) ) ;
1195
1202
for ( i, lifetimes) in lifetimes. enumerate ( ) {
1196
1203
let l1 = lifetime_display ( lifetimes. 0 ) ;
1197
1204
let l2 = lifetime_display ( lifetimes. 1 ) ;
1198
- if lifetimes. 0 == lifetimes. 1 {
1199
- values. 0 . push_normal ( "'_" ) ;
1200
- values. 1 . push_normal ( "'_" ) ;
1201
- } else {
1205
+ if lifetimes. 0 != lifetimes. 1 {
1202
1206
values. 0 . push_highlighted ( l1) ;
1203
1207
values. 1 . push_highlighted ( l2) ;
1208
+ } else if lifetimes. 0 . is_late_bound ( ) {
1209
+ values. 0 . push_normal ( l1) ;
1210
+ values. 1 . push_normal ( l2) ;
1211
+ } else {
1212
+ values. 0 . push_normal ( "'_" ) ;
1213
+ values. 1 . push_normal ( "'_" ) ;
1204
1214
}
1205
1215
self . push_comma ( & mut values. 0 , & mut values. 1 , len, i) ;
1206
1216
}
0 commit comments