@@ -112,19 +112,18 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
112112 /// to find a good name from that. Returns `None` if we can't find
113113 /// one (e.g., this is just some random part of the CFG).
114114 pub ( super ) fn to_error_region ( & self , r : RegionVid ) -> Option < ty:: Region < ' tcx > > {
115- self . to_error_region_vid ( r)
116- . and_then ( |r| self . nonlexical_regioncx . region_definition ( r) . external_name )
115+ self . to_error_region_vid ( r) . and_then ( |r| self . regioncx . region_definition ( r) . external_name )
117116 }
118117
119118 /// Returns the `RegionVid` corresponding to the region returned by
120119 /// `to_error_region`.
121120 pub ( super ) fn to_error_region_vid ( & self , r : RegionVid ) -> Option < RegionVid > {
122- if self . nonlexical_regioncx . universal_regions ( ) . is_universal_region ( r) {
121+ if self . regioncx . universal_regions ( ) . is_universal_region ( r) {
123122 Some ( r)
124123 } else {
125- let upper_bound = self . nonlexical_regioncx . universal_upper_bound ( r) ;
124+ let upper_bound = self . regioncx . universal_upper_bound ( r) ;
126125
127- if self . nonlexical_regioncx . upper_bound_in_region_scc ( r, upper_bound) {
126+ if self . regioncx . upper_bound_in_region_scc ( r, upper_bound) {
128127 self . to_error_region_vid ( upper_bound)
129128 } else {
130129 None
@@ -137,7 +136,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
137136 if let Some ( ty:: ReFree ( free_region) ) = self . to_error_region ( fr) {
138137 if let ty:: BoundRegion :: BrEnv = free_region. bound_region {
139138 if let DefiningTy :: Closure ( def_id, substs) =
140- self . nonlexical_regioncx . universal_regions ( ) . defining_ty
139+ self . regioncx . universal_regions ( ) . defining_ty
141140 {
142141 let closure_kind_ty = substs. as_closure ( ) . kind_ty ( def_id, self . infcx . tcx ) ;
143142 return Some ( ty:: ClosureKind :: FnMut ) == closure_kind_ty. to_opt_closure_kind ( ) ;
@@ -219,11 +218,10 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
219218 fr_origin,
220219 error_element,
221220 } => {
222- let error_region =
223- self . nonlexical_regioncx . region_from_element ( longer_fr, error_element) ;
221+ let error_region = self . regioncx . region_from_element ( longer_fr, error_element) ;
224222
225223 // Find the code to blame for the fact that `longer_fr` outlives `error_fr`.
226- let ( _, span) = self . nonlexical_regioncx . find_outlives_blame_span (
224+ let ( _, span) = self . regioncx . find_outlives_blame_span (
227225 & self . body ,
228226 longer_fr,
229227 fr_origin,
@@ -286,8 +284,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
286284 debug ! ( "report_error(fr={:?}, outlived_fr={:?})" , fr, outlived_fr) ;
287285
288286 let ( category, _, span) =
289- self . nonlexical_regioncx . best_blame_constraint ( & self . body , fr, fr_origin, |r| {
290- self . nonlexical_regioncx . provides_universal_region ( r, fr, outlived_fr)
287+ self . regioncx . best_blame_constraint ( & self . body , fr, fr_origin, |r| {
288+ self . regioncx . provides_universal_region ( r, fr, outlived_fr)
291289 } ) ;
292290
293291 debug ! ( "report_error: category={:?} {:?}" , category, span) ;
@@ -302,8 +300,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
302300 }
303301
304302 let ( fr_is_local, outlived_fr_is_local) : ( bool , bool ) = (
305- self . nonlexical_regioncx . universal_regions ( ) . is_local_free_region ( fr) ,
306- self . nonlexical_regioncx . universal_regions ( ) . is_local_free_region ( outlived_fr) ,
303+ self . regioncx . universal_regions ( ) . is_local_free_region ( fr) ,
304+ self . regioncx . universal_regions ( ) . is_local_free_region ( outlived_fr) ,
307305 ) ;
308306
309307 debug ! (
@@ -378,7 +376,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
378376 // We should check if the return type of this closure is in fact a closure - in that
379377 // case, we can special case the error further.
380378 let return_type_is_closure =
381- self . nonlexical_regioncx . universal_regions ( ) . unnormalized_output_ty . is_closure ( ) ;
379+ self . regioncx . universal_regions ( ) . unnormalized_output_ty . is_closure ( ) ;
382380 let message = if return_type_is_closure {
383381 "returns a closure that contains a reference to a captured variable, which then \
384382 escapes the closure body"
@@ -430,22 +428,22 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
430428 ) -> DiagnosticBuilder < ' tcx > {
431429 let ErrorConstraintInfo { span, category, .. } = errci;
432430
433- let fr_name_and_span = self . nonlexical_regioncx . get_var_name_and_span_for_region (
431+ let fr_name_and_span = self . regioncx . get_var_name_and_span_for_region (
434432 self . infcx . tcx ,
435433 & self . body ,
436434 & self . local_names ,
437435 & self . upvars ,
438436 errci. fr ,
439437 ) ;
440- let outlived_fr_name_and_span = self . nonlexical_regioncx . get_var_name_and_span_for_region (
438+ let outlived_fr_name_and_span = self . regioncx . get_var_name_and_span_for_region (
441439 self . infcx . tcx ,
442440 & self . body ,
443441 & self . local_names ,
444442 & self . upvars ,
445443 errci. outlived_fr ,
446444 ) ;
447445
448- let escapes_from = match self . nonlexical_regioncx . universal_regions ( ) . defining_ty {
446+ let escapes_from = match self . regioncx . universal_regions ( ) . defining_ty {
449447 DefiningTy :: Closure ( ..) => "closure" ,
450448 DefiningTy :: Generator ( ..) => "generator" ,
451449 DefiningTy :: FnDef ( ..) => "function" ,
0 commit comments