@@ -17,13 +17,14 @@ use crate::solve::EvalCtxt;
17
17
// For types with an "existential" binder, i.e. coroutine witnesses, we also
18
18
// instantiate the binder with placeholders eagerly.
19
19
#[ instrument( level = "trace" , skip( ecx) , ret) ]
20
- pub ( in crate :: solve) fn instantiate_constituent_tys_for_auto_trait <
21
- Infcx : InferCtxtLike < Interner = I > ,
22
- I : Interner ,
23
- > (
20
+ pub ( in crate :: solve) fn instantiate_constituent_tys_for_auto_trait < Infcx , I > (
24
21
ecx : & EvalCtxt < ' _ , Infcx > ,
25
22
ty : I :: Ty ,
26
- ) -> Result < Vec < ty:: Binder < I , I :: Ty > > , NoSolution > {
23
+ ) -> Result < Vec < ty:: Binder < I , I :: Ty > > , NoSolution >
24
+ where
25
+ Infcx : InferCtxtLike < Interner = I > ,
26
+ I : Interner ,
27
+ {
27
28
let tcx = ecx. interner ( ) ;
28
29
match ty. kind ( ) {
29
30
ty:: Uint ( _)
@@ -79,6 +80,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<
79
80
ty:: CoroutineWitness ( def_id, args) => Ok ( ecx
80
81
. interner ( )
81
82
. bound_coroutine_hidden_types ( def_id)
83
+ . into_iter ( )
82
84
. map ( |bty| bty. instantiate ( tcx, & args) )
83
85
. collect ( ) ) ,
84
86
@@ -101,13 +103,14 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<
101
103
}
102
104
103
105
#[ instrument( level = "trace" , skip( ecx) , ret) ]
104
- pub ( in crate :: solve) fn instantiate_constituent_tys_for_sized_trait <
105
- Infcx : InferCtxtLike < Interner = I > ,
106
- I : Interner ,
107
- > (
106
+ pub ( in crate :: solve) fn instantiate_constituent_tys_for_sized_trait < Infcx , I > (
108
107
ecx : & EvalCtxt < ' _ , Infcx > ,
109
108
ty : I :: Ty ,
110
- ) -> Result < Vec < ty:: Binder < I , I :: Ty > > , NoSolution > {
109
+ ) -> Result < Vec < ty:: Binder < I , I :: Ty > > , NoSolution >
110
+ where
111
+ Infcx : InferCtxtLike < Interner = I > ,
112
+ I : Interner ,
113
+ {
111
114
match ty. kind ( ) {
112
115
// impl Sized for u*, i*, bool, f*, FnDef, FnPtr, *(const/mut) T, char, &mut? T, [T; N], dyn* Trait, !
113
116
// impl Sized for Coroutine, CoroutineWitness, Closure, CoroutineClosure
@@ -168,13 +171,14 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_sized_trait<
168
171
}
169
172
170
173
#[ instrument( level = "trace" , skip( ecx) , ret) ]
171
- pub ( in crate :: solve) fn instantiate_constituent_tys_for_copy_clone_trait <
172
- Infcx : InferCtxtLike < Interner = I > ,
173
- I : Interner ,
174
- > (
174
+ pub ( in crate :: solve) fn instantiate_constituent_tys_for_copy_clone_trait < Infcx , I > (
175
175
ecx : & EvalCtxt < ' _ , Infcx > ,
176
176
ty : I :: Ty ,
177
- ) -> Result < Vec < ty:: Binder < I , I :: Ty > > , NoSolution > {
177
+ ) -> Result < Vec < ty:: Binder < I , I :: Ty > > , NoSolution >
178
+ where
179
+ Infcx : InferCtxtLike < Interner = I > ,
180
+ I : Interner ,
181
+ {
178
182
match ty. kind ( ) {
179
183
// impl Copy/Clone for FnDef, FnPtr
180
184
ty:: FnDef ( ..) | ty:: FnPtr ( _) | ty:: Error ( _) => Ok ( vec ! [ ] ) ,
@@ -239,6 +243,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<
239
243
ty:: CoroutineWitness ( def_id, args) => Ok ( ecx
240
244
. interner ( )
241
245
. bound_coroutine_hidden_types ( def_id)
246
+ . into_iter ( )
242
247
. map ( |bty| bty. instantiate ( ecx. interner ( ) , & args) )
243
248
. collect ( ) ) ,
244
249
}
@@ -651,15 +656,16 @@ fn coroutine_closure_to_ambiguous_coroutine<I: Interner>(
651
656
// This is unsound in general and once that is fixed, we don't need to
652
657
// normalize eagerly here. See https://github.com/lcnr/solver-woes/issues/9
653
658
// for more details.
654
- pub ( in crate :: solve) fn predicates_for_object_candidate <
655
- Infcx : InferCtxtLike < Interner = I > ,
656
- I : Interner ,
657
- > (
659
+ pub ( in crate :: solve) fn predicates_for_object_candidate < Infcx , I > (
658
660
ecx : & EvalCtxt < ' _ , Infcx > ,
659
661
param_env : I :: ParamEnv ,
660
662
trait_ref : ty:: TraitRef < I > ,
661
663
object_bounds : I :: BoundExistentialPredicates ,
662
- ) -> Vec < Goal < I , I :: Predicate > > {
664
+ ) -> Vec < Goal < I , I :: Predicate > >
665
+ where
666
+ Infcx : InferCtxtLike < Interner = I > ,
667
+ I : Interner ,
668
+ {
663
669
let tcx = ecx. interner ( ) ;
664
670
let mut requirements = vec ! [ ] ;
665
671
requirements
0 commit comments