@@ -10,7 +10,7 @@ use rustc_middle::ty::{self, RegionVid, Ty};
10
10
use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
11
11
use rustc_span:: { Span , DUMMY_SP } ;
12
12
13
- use crate :: { nll :: ToRegionVid , universal_regions:: DefiningTy , MirBorrowckCtxt } ;
13
+ use crate :: { universal_regions:: DefiningTy , MirBorrowckCtxt } ;
14
14
15
15
/// A name for a particular region used in emitting diagnostics. This name could be a generated
16
16
/// name like `'1`, a name used by the user like `'a`, or a name like `'static`.
@@ -497,7 +497,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
497
497
// &
498
498
// - let's call the lifetime of this reference `'1`
499
499
( 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 {
501
501
// Just grab the first character, the `&`.
502
502
let source_map = self . infcx . tcx . sess . source_map ( ) ;
503
503
let ampersand_span = source_map. start_point ( hir_ty. span ) ;
@@ -598,7 +598,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
598
598
for ( kind, hir_arg) in iter:: zip ( substs, args. args ) {
599
599
match ( kind. unpack ( ) , hir_arg) {
600
600
( GenericArgKind :: Lifetime ( r) , hir:: GenericArg :: Lifetime ( lt) ) => {
601
- if r. to_region_vid ( ) == needle_fr {
601
+ if r. as_var ( ) == needle_fr {
602
602
return Some ( lt) ;
603
603
}
604
604
}
@@ -666,7 +666,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
666
666
667
667
let return_ty = self . regioncx . universal_regions ( ) . unnormalized_output_ty ;
668
668
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) {
670
670
return None ;
671
671
}
672
672
@@ -803,7 +803,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
803
803
804
804
let tcx = self . infcx . tcx ;
805
805
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) {
807
807
return None ;
808
808
}
809
809
0 commit comments