@@ -167,20 +167,11 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::GoalData<RustInterner<'tcx>>> for ty::Predi
167167 ty:: PredicateKind :: Projection ( predicate) => predicate. lower_into ( interner) ,
168168 ty:: PredicateKind :: WellFormed ( arg) => match arg. unpack ( ) {
169169 GenericArgKind :: Type ( ty) => match ty. kind {
170- // These types are always WF.
171- ty:: Str | ty:: Placeholder ( ..) | ty:: Error ( _) | ty:: Never => {
172- chalk_ir:: GoalData :: All ( chalk_ir:: Goals :: new ( interner) )
173- }
174-
175- // FIXME(chalk): Well-formed only if ref lifetime outlives type
176- ty:: Ref ( ..) => chalk_ir:: GoalData :: All ( chalk_ir:: Goals :: new ( interner) ) ,
177-
178- ty:: Param ( ..) => panic ! ( "No Params expected." ) ,
170+ // FIXME(chalk): In Chalk, a placeholder is WellFormed if it
171+ // `FromEnv`. However, when we "lower" Params, we don't update
172+ // the environment.
173+ ty:: Placeholder ( ..) => chalk_ir:: GoalData :: All ( chalk_ir:: Goals :: new ( interner) ) ,
179174
180- // FIXME(chalk) -- ultimately I think this is what we
181- // want to do, and we just have rules for how to prove
182- // `WellFormed` for everything above, instead of
183- // inlining a bit the rules of the proof here.
184175 _ => chalk_ir:: GoalData :: DomainGoal ( chalk_ir:: DomainGoal :: WellFormed (
185176 chalk_ir:: WellFormed :: Ty ( ty. lower_into ( interner) ) ,
186177 ) ) ,
@@ -360,9 +351,9 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
360351 ) ,
361352 )
362353 }
363- FnDef ( def_id, _ ) => apply (
354+ FnDef ( def_id, substs ) => apply (
364355 chalk_ir:: TypeName :: FnDef ( chalk_ir:: FnDefId ( RustDefId :: FnDef ( def_id) ) ) ,
365- empty ( ) ,
356+ substs . lower_into ( interner ) ,
366357 ) ,
367358 FnPtr ( sig) => {
368359 let ( inputs_and_outputs, binders, _named_regions) =
0 commit comments