@@ -138,8 +138,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
138138 if let DefiningTy :: Closure ( def_id, substs) =
139139 self . regioncx . universal_regions ( ) . defining_ty
140140 {
141- let closure_kind_ty = substs. as_closure ( ) . kind_ty ( def_id, self . infcx . tcx ) ;
142- return Some ( ty:: ClosureKind :: FnMut ) == closure_kind_ty . to_opt_closure_kind ( ) ;
141+ return substs. as_closure ( ) . kind ( def_id, self . infcx . tcx )
142+ == ty:: ClosureKind :: FnMut ;
143143 }
144144 }
145145 }
@@ -160,7 +160,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
160160 // Try to convert the lower-bound region into something named we can print for the user.
161161 let lower_bound_region = self . to_error_region ( type_test. lower_bound ) ;
162162
163- // Skip duplicate-ish errors.
164163 let type_test_span = type_test. locations . span ( & self . body ) ;
165164
166165 if let Some ( lower_bound_region) = lower_bound_region {
@@ -236,7 +235,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
236235
237236 RegionErrorKind :: RegionError { fr_origin, longer_fr, shorter_fr, is_reported } => {
238237 if is_reported {
239- self . report_error (
238+ self . report_region_error (
240239 longer_fr,
241240 fr_origin,
242241 shorter_fr,
@@ -270,21 +269,21 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
270269 /// ```
271270 ///
272271 /// Here we would be invoked with `fr = 'a` and `outlived_fr = `'b`.
273- pub ( in crate :: borrow_check) fn report_error (
272+ pub ( in crate :: borrow_check) fn report_region_error (
274273 & mut self ,
275274 fr : RegionVid ,
276275 fr_origin : NLLRegionVariableOrigin ,
277276 outlived_fr : RegionVid ,
278277 outlives_suggestion : & mut OutlivesSuggestionBuilder ,
279278 ) {
280- debug ! ( "report_error (fr={:?}, outlived_fr={:?})" , fr, outlived_fr) ;
279+ debug ! ( "report_region_error (fr={:?}, outlived_fr={:?})" , fr, outlived_fr) ;
281280
282281 let ( category, _, span) =
283282 self . regioncx . best_blame_constraint ( & self . body , fr, fr_origin, |r| {
284283 self . regioncx . provides_universal_region ( r, fr, outlived_fr)
285284 } ) ;
286285
287- debug ! ( "report_error : category={:?} {:?}" , category, span) ;
286+ debug ! ( "report_region_error : category={:?} {:?}" , category, span) ;
288287 // Check if we can use one of the "nice region errors".
289288 if let ( Some ( f) , Some ( o) ) = ( self . to_error_region ( fr) , self . to_error_region ( outlived_fr) ) {
290289 let tables = self . infcx . tcx . typeck_tables_of ( self . mir_def_id ) ;
@@ -301,7 +300,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
301300 ) ;
302301
303302 debug ! (
304- "report_error : fr_is_local={:?} outlived_fr_is_local={:?} category={:?}" ,
303+ "report_region_error : fr_is_local={:?} outlived_fr_is_local={:?} category={:?}" ,
305304 fr_is_local, outlived_fr_is_local, category
306305 ) ;
307306
0 commit comments