@@ -22,7 +22,7 @@ use rustc::ty;
2222use rustc_data_structures:: fx:: FxHashSet ;
2323use rustc_data_structures:: sync:: Lrc ;
2424use 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 ;
2626use syntax_pos:: Span ;
2727
2828use super :: borrow_set:: BorrowData ;
@@ -1358,24 +1358,28 @@ impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
13581358 }
13591359 }
13601360
1361+ /// Return the name of the provided `Ty` (that must be a reference) with a synthesized lifetime
1362+ /// name where required.
13611363 fn get_name_for_ty ( & self , ty : ty:: Ty < ' tcx > , counter : usize ) -> String {
13621364 // We need to add synthesized lifetimes where appropriate. We do
13631365 // this by hooking into the pretty printer and telling it to label the
13641366 // lifetimes without names with the value `'0`.
13651367 match ty. sty {
13661368 ty:: TyKind :: Ref ( ty:: RegionKind :: ReLateBound ( _, br) , _, _) |
13671369 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) ) ,
13691371 _ => format ! ( "{}" , ty) ,
13701372 }
13711373 }
13721374
1375+ /// Return the name of the provided `Ty` (that must be a reference)'s region with a
1376+ /// synthesized lifetime name where required.
13731377 fn get_region_name_for_ty ( & self , ty : ty:: Ty < ' tcx > , counter : usize ) -> String {
13741378 match ty. sty {
13751379 ty:: TyKind :: Ref ( region, _, _) => match region {
13761380 ty:: RegionKind :: ReLateBound ( _, br) |
13771381 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) ) ,
13791383 _ => format ! ( "{}" , region) ,
13801384 }
13811385 _ => bug ! ( "ty for annotation of borrow region is not a reference" ) ,
0 commit comments