@@ -326,18 +326,16 @@ impl<'tcx> InferCtxt<'tcx> {
326326 ) -> RelateResult < ' tcx , ty:: Const < ' tcx > > {
327327 let span =
328328 self . inner . borrow_mut ( ) . const_unification_table ( ) . probe_value ( target_vid) . origin . span ;
329- let Generalization { value, needs_wf : _ } = generalize:: generalize (
329+ // FIXME(generic_const_exprs): Occurs check failures for unevaluated
330+ // constants and generic expressions are not yet handled correctly.
331+ let Generalization { value_may_be_infer : value, needs_wf : _ } = generalize:: generalize (
330332 self ,
331333 & mut CombineDelegate { infcx : self , span, param_env } ,
332334 ct,
333335 target_vid,
334336 ty:: Variance :: Invariant ,
335337 ) ?;
336338
337- // FIXME(generic_const_exprs): Occurs check failures for unevaluated
338- // constants and generic expressions are not yet handled correctly.
339- let value = value. may_be_infer ( ) ;
340-
341339 self . inner . borrow_mut ( ) . const_unification_table ( ) . union_value (
342340 target_vid,
343341 ConstVarValue {
@@ -449,7 +447,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
449447 // `'?2` and `?3` are fresh region/type inference
450448 // variables. (Down below, we will relate `a_ty <: b_ty`,
451449 // adding constraints like `'x: '?2` and `?1 <: ?3`.)
452- let Generalization { value , needs_wf } = generalize:: generalize (
450+ let Generalization { value_may_be_infer : b_ty , needs_wf } = generalize:: generalize (
453451 self . infcx ,
454452 & mut CombineDelegate {
455453 infcx : self . infcx ,
@@ -461,7 +459,6 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
461459 ambient_variance,
462460 ) ?;
463461
464- let b_ty = value. may_be_infer ( ) ; // we handle this further down.
465462 self . infcx . inner . borrow_mut ( ) . type_variables ( ) . instantiate ( b_vid, b_ty) ;
466463
467464 if needs_wf {
@@ -501,6 +498,11 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
501498 }
502499 }
503500 }
501+
502+ // FIXME: This does not handle subtyping correctly, we should switch to
503+ // alias-relate in the new solver and could instead create a new inference
504+ // variable for `a_ty`, emitting `Projection(a_ty, a_infer)` and
505+ // `a_infer <: b_ty`.
504506 self . obligations . push ( Obligation :: new (
505507 self . tcx ( ) ,
506508 self . trace . cause . clone ( ) ,
0 commit comments