4545 T : TypeFoldable < TyCtxt < ' tcx > > ,
4646 E : FromSolverError < ' tcx , NextSolverError < ' tcx > > ,
4747{
48- let ( value, goals) =
49- deeply_normalize_with_skipped_universes_and_ambiguous_goals ( at, value, universes) ?;
50- assert_eq ! ( goals, vec![ ] ) ;
48+ let ( value, coroutine_goals) =
49+ deeply_normalize_with_skipped_universes_and_ambiguous_coroutine_goals (
50+ at, value, universes,
51+ ) ?;
52+ assert_eq ! ( coroutine_goals, vec![ ] ) ;
5153
5254 Ok ( value)
5355}
5961/// entered before passing `value` to the function. This is currently needed for
6062/// `normalize_erasing_regions`, which skips binders as it walks through a type.
6163///
62- /// This returns a set of stalled obligations if the typing mode of the underlying infcx
63- /// has any stalled coroutine def ids.
64- pub fn deeply_normalize_with_skipped_universes_and_ambiguous_goals < ' tcx , T , E > (
64+ /// This returns a set of stalled obligations involving coroutines if the typing mode of
65+ /// the underlying infcx has any stalled coroutine def ids.
66+ pub fn deeply_normalize_with_skipped_universes_and_ambiguous_coroutine_goals < ' tcx , T , E > (
6567 at : At < ' _ , ' tcx > ,
6668 value : T ,
6769 universes : Vec < Option < UniverseIndex > > ,
@@ -71,19 +73,24 @@ where
7173 E : FromSolverError < ' tcx , NextSolverError < ' tcx > > ,
7274{
7375 let fulfill_cx = FulfillmentCtxt :: new ( at. infcx ) ;
74- let mut folder =
75- NormalizationFolder { at, fulfill_cx, depth : 0 , universes, stalled_goals : vec ! [ ] } ;
76+ let mut folder = NormalizationFolder {
77+ at,
78+ fulfill_cx,
79+ depth : 0 ,
80+ universes,
81+ stalled_coroutine_goals : vec ! [ ] ,
82+ } ;
7683 let value = value. try_fold_with ( & mut folder) ?;
7784 let errors = folder. fulfill_cx . select_all_or_error ( at. infcx ) ;
78- if errors. is_empty ( ) { Ok ( ( value, folder. stalled_goals ) ) } else { Err ( errors) }
85+ if errors. is_empty ( ) { Ok ( ( value, folder. stalled_coroutine_goals ) ) } else { Err ( errors) }
7986}
8087
8188struct NormalizationFolder < ' me , ' tcx , E > {
8289 at : At < ' me , ' tcx > ,
8390 fulfill_cx : FulfillmentCtxt < ' tcx , E > ,
8491 depth : usize ,
8592 universes : Vec < Option < UniverseIndex > > ,
86- stalled_goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
93+ stalled_coroutine_goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
8794}
8895
8996impl < ' tcx , E > NormalizationFolder < ' _ , ' tcx , E >
@@ -182,7 +189,7 @@ where
182189 return Err ( errors) ;
183190 }
184191
185- self . stalled_goals . extend (
192+ self . stalled_coroutine_goals . extend (
186193 self . fulfill_cx
187194 . drain_stalled_obligations_for_coroutines ( self . at . infcx )
188195 . into_iter ( )
@@ -298,13 +305,13 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for DeeplyNormalizeForDiagnosticsFolder<'_,
298305
299306 fn fold_ty ( & mut self , ty : Ty < ' tcx > ) -> Ty < ' tcx > {
300307 let infcx = self . at . infcx ;
301- let result =
302- infcx . commit_if_ok ( |_| {
303- deeply_normalize_with_skipped_universes_and_ambiguous_goals :: <
304- _ ,
305- ScrubbedTraitError < ' tcx > ,
306- > ( self . at , ty , vec ! [ None ; ty . outer_exclusive_binder ( ) . as_usize ( ) ] )
307- } ) ;
308+ let result: Result < _ , Vec < ScrubbedTraitError < ' tcx > > > = infcx . commit_if_ok ( |_| {
309+ deeply_normalize_with_skipped_universes_and_ambiguous_coroutine_goals (
310+ self . at ,
311+ ty ,
312+ vec ! [ None ; ty . outer_exclusive_binder ( ) . as_usize ( ) ] ,
313+ )
314+ } ) ;
308315 match result {
309316 Ok ( ( ty, _) ) => ty,
310317 Err ( _) => ty. super_fold_with ( self ) ,
@@ -313,13 +320,13 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for DeeplyNormalizeForDiagnosticsFolder<'_,
313320
314321 fn fold_const ( & mut self , ct : ty:: Const < ' tcx > ) -> ty:: Const < ' tcx > {
315322 let infcx = self . at . infcx ;
316- let result =
317- infcx . commit_if_ok ( |_| {
318- deeply_normalize_with_skipped_universes_and_ambiguous_goals :: <
319- _ ,
320- ScrubbedTraitError < ' tcx > ,
321- > ( self . at , ct , vec ! [ None ; ct . outer_exclusive_binder ( ) . as_usize ( ) ] )
322- } ) ;
323+ let result: Result < _ , Vec < ScrubbedTraitError < ' tcx > > > = infcx . commit_if_ok ( |_| {
324+ deeply_normalize_with_skipped_universes_and_ambiguous_coroutine_goals (
325+ self . at ,
326+ ct ,
327+ vec ! [ None ; ct . outer_exclusive_binder ( ) . as_usize ( ) ] ,
328+ )
329+ } ) ;
323330 match result {
324331 Ok ( ( ct, _) ) => ct,
325332 Err ( _) => ct. super_fold_with ( self ) ,
0 commit comments