@@ -22,7 +22,7 @@ use rustc::ty;
22
22
use rustc_data_structures:: fx:: FxHashSet ;
23
23
use rustc_data_structures:: sync:: Lrc ;
24
24
use rustc_errors:: { Applicability , DiagnosticBuilder } ;
25
- use rustc:: util:: ppaux:: with_highlight_region_for_region ;
25
+ use rustc:: util:: ppaux:: with_highlight_region_for_bound_region ;
26
26
use syntax_pos:: Span ;
27
27
28
28
use super :: borrow_set:: BorrowData ;
@@ -1358,24 +1358,28 @@ impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
1358
1358
}
1359
1359
}
1360
1360
1361
+ /// Return the name of the provided `Ty` (that must be a reference) with a synthesized lifetime
1362
+ /// name where required.
1361
1363
fn get_name_for_ty ( & self , ty : ty:: Ty < ' tcx > , counter : usize ) -> String {
1362
1364
// We need to add synthesized lifetimes where appropriate. We do
1363
1365
// this by hooking into the pretty printer and telling it to label the
1364
1366
// lifetimes without names with the value `'0`.
1365
1367
match ty. sty {
1366
1368
ty:: TyKind :: Ref ( ty:: RegionKind :: ReLateBound ( _, br) , _, _) |
1367
1369
ty:: TyKind :: Ref ( ty:: RegionKind :: ReSkolemized ( _, br) , _, _) =>
1368
- with_highlight_region_for_region ( * br, counter, || format ! ( "{}" , ty) ) ,
1370
+ with_highlight_region_for_bound_region ( * br, counter, || format ! ( "{}" , ty) ) ,
1369
1371
_ => format ! ( "{}" , ty) ,
1370
1372
}
1371
1373
}
1372
1374
1375
+ /// Return the name of the provided `Ty` (that must be a reference)'s region with a
1376
+ /// synthesized lifetime name where required.
1373
1377
fn get_region_name_for_ty ( & self , ty : ty:: Ty < ' tcx > , counter : usize ) -> String {
1374
1378
match ty. sty {
1375
1379
ty:: TyKind :: Ref ( region, _, _) => match region {
1376
1380
ty:: RegionKind :: ReLateBound ( _, br) |
1377
1381
ty:: RegionKind :: ReSkolemized ( _, br) =>
1378
- with_highlight_region_for_region ( * br, counter, || format ! ( "{}" , region) ) ,
1382
+ with_highlight_region_for_bound_region ( * br, counter, || format ! ( "{}" , region) ) ,
1379
1383
_ => format ! ( "{}" , region) ,
1380
1384
}
1381
1385
_ => bug ! ( "ty for annotation of borrow region is not a reference" ) ,
0 commit comments