@@ -88,8 +88,8 @@ use middle::mem_categorization as mc;
8888use middle:: mem_categorization:: Categorization ;
8989use middle:: region;
9090use rustc:: hir:: def_id:: DefId ;
91- use rustc:: infer:: { self , RegionObligation , UnlessNll } ;
9291use rustc:: infer:: outlives:: env:: OutlivesEnvironment ;
92+ use rustc:: infer:: { self , RegionObligation , SuppressRegionErrors } ;
9393use rustc:: ty:: adjustment;
9494use rustc:: ty:: subst:: Substs ;
9595use rustc:: ty:: { self , Ty } ;
@@ -140,7 +140,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
140140 rcx. visit_body ( body) ;
141141 rcx. visit_region_obligations ( id) ;
142142 }
143- rcx. resolve_regions_and_report_errors ( UnlessNll ( true ) ) ;
143+ rcx. resolve_regions_and_report_errors ( SuppressRegionErrors :: when_nll_is_enabled ( self . tcx ) ) ;
144144
145145 assert ! ( self . tables. borrow( ) . free_region_map. is_empty( ) ) ;
146146 self . tables . borrow_mut ( ) . free_region_map = rcx. outlives_environment . into_free_region_map ( ) ;
@@ -162,7 +162,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
162162 . add_implied_bounds ( self , wf_tys, item_id, span) ;
163163 rcx. outlives_environment . save_implied_bounds ( item_id) ;
164164 rcx. visit_region_obligations ( item_id) ;
165- rcx. resolve_regions_and_report_errors ( UnlessNll ( false ) ) ;
165+ rcx. resolve_regions_and_report_errors ( SuppressRegionErrors :: default ( ) ) ;
166166 }
167167
168168 /// Region check a function body. Not invoked on closures, but
@@ -190,7 +190,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
190190 rcx. visit_fn_body ( fn_id, body, self . tcx . hir . span ( fn_id) ) ;
191191 }
192192
193- rcx. resolve_regions_and_report_errors ( UnlessNll ( true ) ) ;
193+ rcx. resolve_regions_and_report_errors ( SuppressRegionErrors :: when_nll_is_enabled ( self . tcx ) ) ;
194194
195195 // In this mode, we also copy the free-region-map into the
196196 // tables of the enclosing fcx. In the other regionck modes
@@ -314,7 +314,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
314314 id : ast:: NodeId , // the id of the fn itself
315315 body : & ' gcx hir:: Body ,
316316 span : Span ,
317- ) {
317+ ) {
318318 // When we enter a function, we can derive
319319 debug ! ( "visit_fn_body(id={})" , id) ;
320320
@@ -355,7 +355,8 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
355355 body_id. node_id ,
356356 span,
357357 ) ;
358- self . outlives_environment . save_implied_bounds ( body_id. node_id ) ;
358+ self . outlives_environment
359+ . save_implied_bounds ( body_id. node_id ) ;
359360 self . link_fn_args (
360361 region:: Scope {
361362 id : body. value . hir_id . local_id ,
@@ -392,7 +393,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
392393 self . select_all_obligations_or_error ( ) ;
393394 }
394395
395- fn resolve_regions_and_report_errors ( & self , unless_nll : UnlessNll ) {
396+ fn resolve_regions_and_report_errors ( & self , suppress : SuppressRegionErrors ) {
396397 self . infcx . process_registered_region_obligations (
397398 self . outlives_environment . region_bound_pairs_map ( ) ,
398399 self . implicit_region_bound ,
@@ -403,7 +404,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
403404 self . subject_def_id ,
404405 & self . region_scope_tree ,
405406 & self . outlives_environment ,
406- unless_nll ,
407+ suppress ,
407408 ) ;
408409 }
409410
0 commit comments