@@ -11,7 +11,7 @@ use crate::solve::EvalCtxt;
1111//
1212// For types with an "existential" binder, i.e. generator witnesses, we also
1313// 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 > (
1515 ecx : & EvalCtxt < ' _ , ' tcx > ,
1616 ty : Ty < ' tcx > ,
1717) -> Result < Vec < Ty < ' tcx > > , NoSolution > {
@@ -87,7 +87,7 @@ pub(crate) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
8787 }
8888}
8989
90- pub ( crate ) fn replace_erased_lifetimes_with_bound_vars < ' tcx > (
90+ pub ( in crate :: solve ) fn replace_erased_lifetimes_with_bound_vars < ' tcx > (
9191 tcx : TyCtxt < ' tcx > ,
9292 ty : Ty < ' tcx > ,
9393) -> ty:: Binder < ' tcx , Ty < ' tcx > > {
@@ -108,7 +108,7 @@ pub(crate) fn replace_erased_lifetimes_with_bound_vars<'tcx>(
108108 ty:: Binder :: bind_with_vars ( ty, bound_vars)
109109}
110110
111- pub ( crate ) fn instantiate_constituent_tys_for_sized_trait < ' tcx > (
111+ pub ( in crate :: solve ) fn instantiate_constituent_tys_for_sized_trait < ' tcx > (
112112 ecx : & EvalCtxt < ' _ , ' tcx > ,
113113 ty : Ty < ' tcx > ,
114114) -> Result < Vec < Ty < ' tcx > > , NoSolution > {
@@ -158,7 +158,7 @@ pub(crate) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
158158 }
159159}
160160
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 > (
162162 ecx : & EvalCtxt < ' _ , ' tcx > ,
163163 ty : Ty < ' tcx > ,
164164) -> Result < Vec < Ty < ' tcx > > , NoSolution > {
@@ -224,7 +224,7 @@ pub(crate) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
224224}
225225
226226// 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 > (
228228 tcx : TyCtxt < ' tcx > ,
229229 self_ty : Ty < ' tcx > ,
230230 goal_kind : ty:: ClosureKind ,
@@ -337,7 +337,13 @@ pub(crate) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
337337/// additional step of eagerly folding the associated types in the where
338338/// clauses of the impl. In this example, that means replacing
339339/// `<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 > (
341347 ecx : & EvalCtxt < ' _ , ' tcx > ,
342348 param_env : ty:: ParamEnv < ' tcx > ,
343349 trait_ref : ty:: TraitRef < ' tcx > ,
0 commit comments