@@ -138,8 +138,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
138
138
if let DefiningTy :: Closure ( def_id, substs) =
139
139
self . regioncx . universal_regions ( ) . defining_ty
140
140
{
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 ;
143
143
}
144
144
}
145
145
}
@@ -160,7 +160,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
160
160
// Try to convert the lower-bound region into something named we can print for the user.
161
161
let lower_bound_region = self . to_error_region ( type_test. lower_bound ) ;
162
162
163
- // Skip duplicate-ish errors.
164
163
let type_test_span = type_test. locations . span ( & self . body ) ;
165
164
166
165
if let Some ( lower_bound_region) = lower_bound_region {
@@ -236,7 +235,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
236
235
237
236
RegionErrorKind :: RegionError { fr_origin, longer_fr, shorter_fr, is_reported } => {
238
237
if is_reported {
239
- self . report_error (
238
+ self . report_region_error (
240
239
longer_fr,
241
240
fr_origin,
242
241
shorter_fr,
@@ -270,21 +269,21 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
270
269
/// ```
271
270
///
272
271
/// 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 (
274
273
& mut self ,
275
274
fr : RegionVid ,
276
275
fr_origin : NLLRegionVariableOrigin ,
277
276
outlived_fr : RegionVid ,
278
277
outlives_suggestion : & mut OutlivesSuggestionBuilder ,
279
278
) {
280
- debug ! ( "report_error (fr={:?}, outlived_fr={:?})" , fr, outlived_fr) ;
279
+ debug ! ( "report_region_error (fr={:?}, outlived_fr={:?})" , fr, outlived_fr) ;
281
280
282
281
let ( category, _, span) =
283
282
self . regioncx . best_blame_constraint ( & self . body , fr, fr_origin, |r| {
284
283
self . regioncx . provides_universal_region ( r, fr, outlived_fr)
285
284
} ) ;
286
285
287
- debug ! ( "report_error : category={:?} {:?}" , category, span) ;
286
+ debug ! ( "report_region_error : category={:?} {:?}" , category, span) ;
288
287
// Check if we can use one of the "nice region errors".
289
288
if let ( Some ( f) , Some ( o) ) = ( self . to_error_region ( fr) , self . to_error_region ( outlived_fr) ) {
290
289
let tables = self . infcx . tcx . typeck_tables_of ( self . mir_def_id ) ;
@@ -301,7 +300,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
301
300
) ;
302
301
303
302
debug ! (
304
- "report_error : fr_is_local={:?} outlived_fr_is_local={:?} category={:?}" ,
303
+ "report_region_error : fr_is_local={:?} outlived_fr_is_local={:?} category={:?}" ,
305
304
fr_is_local, outlived_fr_is_local, category
306
305
) ;
307
306
0 commit comments