@@ -366,7 +366,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
366366 ) -> Option < Predicate < ' tcx > > {
367367 use rustc_middle:: ty:: {
368368 Binder , OutlivesPredicate , PredicateKind , ProjectionPredicate , ProjectionTy ,
369- SubtypePredicate , ToPredicate , TraitPredicate ,
369+ SubtypePredicate , ToPredicate , TraitPredicate , WithOptConstParam ,
370370 } ;
371371
372372 Some ( match predicate. kind ( ) {
@@ -450,11 +450,14 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
450450 } ) )
451451 . to_predicate ( self . tcx )
452452 }
453- PredicateKind :: ConstEvaluatable ( orig_did , orig_substs) => {
453+ PredicateKind :: ConstEvaluatable ( param , orig_substs) => {
454454 if let Some ( ( target_def_id, target_substs) ) =
455- self . translate_orig_substs ( index_map, * orig_did , orig_substs)
455+ self . translate_orig_substs ( index_map, param . did , orig_substs)
456456 {
457- PredicateKind :: ConstEvaluatable ( target_def_id, target_substs)
457+ // TODO: We could probably use translated version for
458+ // `WithOptConstParam::const_param_did`
459+ let const_param = WithOptConstParam :: unknown ( target_def_id) ;
460+ PredicateKind :: ConstEvaluatable ( const_param, target_substs)
458461 . to_predicate ( self . tcx )
459462 } else {
460463 return None ;
0 commit comments