Skip to content

Commit

Permalink
WIP: Fix breakage due to rust-lang/rust#74113
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Nov 18, 2020
1 parent 2eec4e1 commit f58afc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2020-07-15
nightly-2020-07-23
11 changes: 7 additions & 4 deletions src/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
) -> Option<Predicate<'tcx>> {
use rustc_middle::ty::{
Binder, OutlivesPredicate, PredicateKind, ProjectionPredicate, ProjectionTy,
SubtypePredicate, ToPredicate, TraitPredicate,
SubtypePredicate, ToPredicate, TraitPredicate, WithOptConstParam,
};

Some(match predicate.kind() {
Expand Down Expand Up @@ -450,11 +450,14 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
}))
.to_predicate(self.tcx)
}
PredicateKind::ConstEvaluatable(orig_did, orig_substs) => {
PredicateKind::ConstEvaluatable(param, orig_substs) => {
if let Some((target_def_id, target_substs)) =
self.translate_orig_substs(index_map, *orig_did, orig_substs)
self.translate_orig_substs(index_map, param.did, orig_substs)
{
PredicateKind::ConstEvaluatable(target_def_id, target_substs)
// TODO: We could probably use translated version for
// `WithOptConstParam::const_param_did`
let const_param = WithOptConstParam::unknown(target_def_id);
PredicateKind::ConstEvaluatable(const_param, target_substs)
.to_predicate(self.tcx)
} else {
return None;
Expand Down

0 comments on commit f58afc6

Please sign in to comment.