@@ -11,7 +11,7 @@ use crate::solve::EvalCtxt;
11
11
//
12
12
// For types with an "existential" binder, i.e. generator witnesses, we also
13
13
// instantiate the binder with placeholders eagerly.
14
- pub ( crate ) fn instantiate_constituent_tys_for_auto_trait < ' tcx > (
14
+ pub ( in crate :: solve ) fn instantiate_constituent_tys_for_auto_trait < ' tcx > (
15
15
ecx : & EvalCtxt < ' _ , ' tcx > ,
16
16
ty : Ty < ' tcx > ,
17
17
) -> Result < Vec < Ty < ' tcx > > , NoSolution > {
@@ -87,7 +87,7 @@ pub(crate) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
87
87
}
88
88
}
89
89
90
- pub ( crate ) fn replace_erased_lifetimes_with_bound_vars < ' tcx > (
90
+ pub ( in crate :: solve ) fn replace_erased_lifetimes_with_bound_vars < ' tcx > (
91
91
tcx : TyCtxt < ' tcx > ,
92
92
ty : Ty < ' tcx > ,
93
93
) -> ty:: Binder < ' tcx , Ty < ' tcx > > {
@@ -108,7 +108,7 @@ pub(crate) fn replace_erased_lifetimes_with_bound_vars<'tcx>(
108
108
ty:: Binder :: bind_with_vars ( ty, bound_vars)
109
109
}
110
110
111
- pub ( crate ) fn instantiate_constituent_tys_for_sized_trait < ' tcx > (
111
+ pub ( in crate :: solve ) fn instantiate_constituent_tys_for_sized_trait < ' tcx > (
112
112
ecx : & EvalCtxt < ' _ , ' tcx > ,
113
113
ty : Ty < ' tcx > ,
114
114
) -> Result < Vec < Ty < ' tcx > > , NoSolution > {
@@ -158,7 +158,7 @@ pub(crate) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
158
158
}
159
159
}
160
160
161
- pub ( crate ) fn instantiate_constituent_tys_for_copy_clone_trait < ' tcx > (
161
+ pub ( in crate :: solve ) fn instantiate_constituent_tys_for_copy_clone_trait < ' tcx > (
162
162
ecx : & EvalCtxt < ' _ , ' tcx > ,
163
163
ty : Ty < ' tcx > ,
164
164
) -> Result < Vec < Ty < ' tcx > > , NoSolution > {
@@ -224,7 +224,7 @@ pub(crate) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
224
224
}
225
225
226
226
// Returns a binder of the tupled inputs types and output type from a builtin callable type.
227
- pub ( crate ) fn extract_tupled_inputs_and_output_from_callable < ' tcx > (
227
+ pub ( in crate :: solve ) fn extract_tupled_inputs_and_output_from_callable < ' tcx > (
228
228
tcx : TyCtxt < ' tcx > ,
229
229
self_ty : Ty < ' tcx > ,
230
230
goal_kind : ty:: ClosureKind ,
@@ -337,7 +337,13 @@ pub(crate) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
337
337
/// additional step of eagerly folding the associated types in the where
338
338
/// clauses of the impl. In this example, that means replacing
339
339
/// `<Self as Foo>::Bar` with `Ty` in the first impl.
340
- pub ( crate ) fn predicates_for_object_candidate < ' tcx > (
340
+ ///
341
+ // FIXME: This is only necessary as `<Self as Trait>::Assoc: ItemBound`
342
+ // bounds in impls are trivially proven using the item bound candidates.
343
+ // This is unsound in general and once that is fixed, we don't need to
344
+ // normalize eagerly here. See https://github.com/lcnr/solver-woes/issues/9
345
+ // for more details.
346
+ pub ( in crate :: solve) fn predicates_for_object_candidate < ' tcx > (
341
347
ecx : & EvalCtxt < ' _ , ' tcx > ,
342
348
param_env : ty:: ParamEnv < ' tcx > ,
343
349
trait_ref : ty:: TraitRef < ' tcx > ,
0 commit comments