@@ -1630,6 +1630,9 @@ impl<'tcx> Ty<'tcx> {
16301630 TyKind :: Coroutine ( def_id, args) => {
16311631 Some ( args. as_coroutine ( ) . variant_range ( * def_id, tcx) )
16321632 }
1633+ TyKind :: UnsafeBinder ( bound_ty) => {
1634+ tcx. instantiate_bound_regions_with_erased ( ( * bound_ty) . into ( ) ) . variant_range ( tcx)
1635+ }
16331636 _ => None ,
16341637 }
16351638 }
@@ -1651,6 +1654,9 @@ impl<'tcx> Ty<'tcx> {
16511654 TyKind :: Coroutine ( def_id, args) => {
16521655 Some ( args. as_coroutine ( ) . discriminant_for_variant ( * def_id, tcx, variant_index) )
16531656 }
1657+ TyKind :: UnsafeBinder ( bound_ty) => tcx
1658+ . instantiate_bound_regions_with_erased ( ( * bound_ty) . into ( ) )
1659+ . discriminant_for_variant ( tcx, variant_index) ,
16541660 _ => None ,
16551661 }
16561662 }
@@ -1669,6 +1675,9 @@ impl<'tcx> Ty<'tcx> {
16691675 }
16701676
16711677 ty:: Pat ( ty, _) => ty. discriminant_ty ( tcx) ,
1678+ ty:: UnsafeBinder ( bound_ty) => {
1679+ tcx. instantiate_bound_regions_with_erased ( ( * bound_ty) . into ( ) ) . discriminant_ty ( tcx)
1680+ }
16721681
16731682 ty:: Bool
16741683 | ty:: Char
@@ -1690,7 +1699,6 @@ impl<'tcx> Ty<'tcx> {
16901699 | ty:: CoroutineWitness ( ..)
16911700 | ty:: Never
16921701 | ty:: Tuple ( _)
1693- | ty:: UnsafeBinder ( _)
16941702 | ty:: Error ( _)
16951703 | ty:: Infer ( IntVar ( _) | FloatVar ( _) ) => tcx. types . u8 ,
16961704
0 commit comments