File tree 1 file changed +11
-11
lines changed
compiler/rustc_borrowck/src
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -909,19 +909,19 @@ impl<'tcx> UniversalRegionIndices<'tcx> {
909
909
/// if it is a placeholder. Handling placeholders requires access to the
910
910
/// `MirTypeckRegionConstraints`.
911
911
fn to_region_vid ( & self , r : ty:: Region < ' tcx > ) -> RegionVid {
912
- if let ty :: ReVar ( .. ) = r. kind ( ) {
913
- r. as_var ( )
914
- } else if let ty:: ReError ( guar) = r . kind ( ) {
915
- self . tainted_by_errors . set ( Some ( guar) ) ;
916
- // We use the `'static` `RegionVid` because `ReError` doesn't actually exist in the
917
- // `UniversalRegionIndices`. This is fine because 1) it is a fallback only used if
918
- // errors are being emitted and 2) it leaves the happy path unaffected.
919
- self . fr_static
920
- } else {
921
- * self
912
+ match r. kind ( ) {
913
+ ty :: ReVar ( .. ) => r. as_var ( ) ,
914
+ ty:: ReError ( guar) => {
915
+ self . tainted_by_errors . set ( Some ( guar) ) ;
916
+ // We use the `'static` `RegionVid` because `ReError` doesn't actually exist in the
917
+ // `UniversalRegionIndices`. This is fine because 1) it is a fallback only used if
918
+ // errors are being emitted and 2) it leaves the happy path unaffected.
919
+ self . fr_static
920
+ }
921
+ _ => * self
922
922
. indices
923
923
. get ( & r)
924
- . unwrap_or_else ( || bug ! ( "cannot convert `{:?}` to a region vid" , r) )
924
+ . unwrap_or_else ( || bug ! ( "cannot convert `{:?}` to a region vid" , r) ) ,
925
925
}
926
926
}
927
927
You can’t perform that action at this time.
0 commit comments