@@ -26,7 +26,7 @@ use crate::query::Providers;
26
26
use crate :: ty:: layout:: { FloatExt , IntegerExt } ;
27
27
use crate :: ty:: {
28
28
self , Asyncness , FallibleTypeFolder , GenericArgKind , GenericArgsRef , Ty , TyCtxt , TypeFoldable ,
29
- TypeFolder , TypeSuperFoldable , TypeVisitableExt , Upcast , fold_regions ,
29
+ TypeFolder , TypeSuperFoldable , TypeVisitableExt , Upcast ,
30
30
} ;
31
31
32
32
#[ derive( Copy , Clone , Debug ) ]
@@ -737,40 +737,6 @@ impl<'tcx> TyCtxt<'tcx> {
737
737
}
738
738
}
739
739
740
- /// Return the set of types that should be taken into account when checking
741
- /// trait bounds on a coroutine's internal state. This properly replaces
742
- /// `ReErased` with new existential bound lifetimes.
743
- pub fn coroutine_hidden_types (
744
- self ,
745
- def_id : DefId ,
746
- ) -> ty:: EarlyBinder < ' tcx , ty:: Binder < ' tcx , & ' tcx ty:: List < Ty < ' tcx > > > > {
747
- let coroutine_layout = self . mir_coroutine_witnesses ( def_id) ;
748
- let mut vars = vec ! [ ] ;
749
- let bound_tys = self . mk_type_list_from_iter (
750
- coroutine_layout
751
- . as_ref ( )
752
- . map_or_else ( || [ ] . iter ( ) , |l| l. field_tys . iter ( ) )
753
- . filter ( |decl| !decl. ignore_for_traits )
754
- . map ( |decl| {
755
- let ty = fold_regions ( self , decl. ty , |re, debruijn| {
756
- assert_eq ! ( re, self . lifetimes. re_erased) ;
757
- let var = ty:: BoundVar :: from_usize ( vars. len ( ) ) ;
758
- vars. push ( ty:: BoundVariableKind :: Region ( ty:: BoundRegionKind :: Anon ) ) ;
759
- ty:: Region :: new_bound (
760
- self ,
761
- debruijn,
762
- ty:: BoundRegion { var, kind : ty:: BoundRegionKind :: Anon } ,
763
- )
764
- } ) ;
765
- ty
766
- } ) ,
767
- ) ;
768
- ty:: EarlyBinder :: bind ( ty:: Binder :: bind_with_vars (
769
- bound_tys,
770
- self . mk_bound_variable_kinds ( & vars) ,
771
- ) )
772
- }
773
-
774
740
/// Expands the given impl trait type, stopping if the type is recursive.
775
741
#[ instrument( skip( self ) , level = "debug" , ret) ]
776
742
pub fn try_expand_impl_trait_type (
0 commit comments