@@ -1191,16 +1191,26 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11911191 // | |
11921192 // | elided as they were the same
11931193 // 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>)
11941201 let lifetimes = sub1. regions ( ) . zip ( sub2. regions ( ) ) ;
11951202 for ( i, lifetimes) in lifetimes. enumerate ( ) {
11961203 let l1 = lifetime_display ( lifetimes. 0 ) ;
11971204 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 {
12021206 values. 0 . push_highlighted ( l1) ;
12031207 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 ( "'_" ) ;
12041214 }
12051215 self . push_comma ( & mut values. 0 , & mut values. 1 , len, i) ;
12061216 }
0 commit comments