@@ -366,7 +366,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
366
366
) -> Option < Predicate < ' tcx > > {
367
367
use rustc_middle:: ty:: {
368
368
Binder , OutlivesPredicate , PredicateKind , ProjectionPredicate , ProjectionTy ,
369
- SubtypePredicate , ToPredicate , TraitPredicate ,
369
+ SubtypePredicate , ToPredicate , TraitPredicate , WithOptConstParam ,
370
370
} ;
371
371
372
372
Some ( match predicate. kind ( ) {
@@ -450,11 +450,14 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
450
450
} ) )
451
451
. to_predicate ( self . tcx )
452
452
}
453
- PredicateKind :: ConstEvaluatable ( orig_did , orig_substs) => {
453
+ PredicateKind :: ConstEvaluatable ( param , orig_substs) => {
454
454
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)
456
456
{
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)
458
461
. to_predicate ( self . tcx )
459
462
} else {
460
463
return None ;
0 commit comments