@@ -288,7 +288,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
288
288
let tcx = self . infcx . tcx ;
289
289
290
290
debug ! ( "give_region_a_name: error_region = {:?}" , error_region) ;
291
- match * error_region {
291
+ match error_region. kind ( ) {
292
292
ty:: ReEarlyParam ( ebr) => ebr. has_name ( ) . then ( || {
293
293
let def_id = tcx. generics_of ( self . mir_def_id ( ) ) . region_param ( ebr, tcx) . def_id ;
294
294
let span = tcx. hir_span_if_local ( def_id) . unwrap_or ( DUMMY_SP ) ;
@@ -896,7 +896,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
896
896
& self ,
897
897
fr : RegionVid ,
898
898
) -> Option < RegionName > {
899
- let ty:: ReEarlyParam ( region) = * self . to_error_region ( fr) ? else {
899
+ let ty:: ReEarlyParam ( region) = self . to_error_region ( fr) ?. kind ( ) else {
900
900
return None ;
901
901
} ;
902
902
if region. has_name ( ) {
@@ -912,7 +912,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
912
912
913
913
let found = tcx
914
914
. any_free_region_meets ( & tcx. type_of ( region_parent) . instantiate_identity ( ) , |r| {
915
- * r == ty:: ReEarlyParam ( region)
915
+ r . kind ( ) == ty:: ReEarlyParam ( region)
916
916
} ) ;
917
917
918
918
Some ( RegionName {
@@ -931,7 +931,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
931
931
& self ,
932
932
fr : RegionVid ,
933
933
) -> Option < RegionName > {
934
- let ty:: ReEarlyParam ( region) = * self . to_error_region ( fr) ? else {
934
+ let ty:: ReEarlyParam ( region) = self . to_error_region ( fr) ?. kind ( ) else {
935
935
return None ;
936
936
} ;
937
937
if region. has_name ( ) {
@@ -1007,7 +1007,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
1007
1007
if data. projection_term . self_ty ( ) == ty => { }
1008
1008
_ => return false ,
1009
1009
}
1010
- tcx. any_free_region_meets ( pred, |r| * r == ty:: ReEarlyParam ( region) )
1010
+ tcx. any_free_region_meets ( pred, |r| r . kind ( ) == ty:: ReEarlyParam ( region) )
1011
1011
} )
1012
1012
} else {
1013
1013
false
0 commit comments