@@ -10,7 +10,7 @@ use rustc_middle::ty::{self, RegionVid, Ty};
1010use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
1111use rustc_span:: { Span , DUMMY_SP } ;
1212
13- use crate :: { nll :: ToRegionVid , universal_regions:: DefiningTy , MirBorrowckCtxt } ;
13+ use crate :: { universal_regions:: DefiningTy , MirBorrowckCtxt } ;
1414
1515/// A name for a particular region used in emitting diagnostics. This name could be a generated
1616/// name like `'1`, a name used by the user like `'a`, or a name like `'static`.
@@ -497,7 +497,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
497497 // &
498498 // - let's call the lifetime of this reference `'1`
499499 ( ty:: Ref ( region, referent_ty, _) , hir:: TyKind :: Ref ( _lifetime, referent_hir_ty) ) => {
500- if region. to_region_vid ( ) == needle_fr {
500+ if region. as_var ( ) == needle_fr {
501501 // Just grab the first character, the `&`.
502502 let source_map = self . infcx . tcx . sess . source_map ( ) ;
503503 let ampersand_span = source_map. start_point ( hir_ty. span ) ;
@@ -598,7 +598,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
598598 for ( kind, hir_arg) in iter:: zip ( substs, args. args ) {
599599 match ( kind. unpack ( ) , hir_arg) {
600600 ( GenericArgKind :: Lifetime ( r) , hir:: GenericArg :: Lifetime ( lt) ) => {
601- if r. to_region_vid ( ) == needle_fr {
601+ if r. as_var ( ) == needle_fr {
602602 return Some ( lt) ;
603603 }
604604 }
@@ -666,7 +666,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
666666
667667 let return_ty = self . regioncx . universal_regions ( ) . unnormalized_output_ty ;
668668 debug ! ( "give_name_if_anonymous_region_appears_in_output: return_ty = {:?}" , return_ty) ;
669- if !tcx. any_free_region_meets ( & return_ty, |r| r. to_region_vid ( ) == fr) {
669+ if !tcx. any_free_region_meets ( & return_ty, |r| r. as_var ( ) == fr) {
670670 return None ;
671671 }
672672
@@ -803,7 +803,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
803803
804804 let tcx = self . infcx . tcx ;
805805
806- if !tcx. any_free_region_meets ( & yield_ty, |r| r. to_region_vid ( ) == fr) {
806+ if !tcx. any_free_region_meets ( & yield_ty, |r| r. as_var ( ) == fr) {
807807 return None ;
808808 }
809809
0 commit comments