Skip to content

Commit c103612

Browse files
committed
1 parent c094967 commit c103612

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2020-07-15
1+
nightly-2020-07-23

src/translate.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)