Skip to content

Commit d8b9387

Browse files
committed
Take ConstValue::Placeholder into account in new locations
1 parent fc16b0a commit d8b9387

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/librustc/ty/structural_impls.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,7 @@ impl<'tcx> TypeFoldable<'tcx> for ConstValue<'tcx> {
13551355
// FIXME(const_generics): implement TypeFoldable for InferConst
13561356
ConstValue::Infer(ic) => ConstValue::Infer(ic),
13571357
ConstValue::Param(p) => ConstValue::Param(p.fold_with(folder)),
1358+
ConstValue::Placeholder(p) => ConstValue::Placeholder(p),
13581359
ConstValue::Scalar(a) => ConstValue::Scalar(a),
13591360
ConstValue::Slice(a, b) => ConstValue::Slice(a, b),
13601361
ConstValue::Unevaluated(did, substs)
@@ -1366,8 +1367,9 @@ impl<'tcx> TypeFoldable<'tcx> for ConstValue<'tcx> {
13661367
match *self {
13671368
ConstValue::ByRef(..) => false,
13681369
// FIXME(const_generics): implement TypeFoldable for InferConst
1369-
ConstValue::Infer(_ic) => false,
1370+
ConstValue::Infer(_) => false,
13701371
ConstValue::Param(p) => p.visit_with(visitor),
1372+
ConstValue::Placeholder(_) => false,
13711373
ConstValue::Scalar(_) => false,
13721374
ConstValue::Slice(..) => false,
13731375
ConstValue::Unevaluated(_, substs) => substs.visit_with(visitor),

src/librustc_typeck/check/writeback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc::infer::InferCtxt;
1111
use rustc::ty::adjustment::{Adjust, Adjustment, PointerCast};
1212
use rustc::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder};
1313
use rustc::ty::subst::UnpackedKind;
14-
use rustc::ty::{self, Ty, TyCtxt, Const};
14+
use rustc::ty::{self, Ty, TyCtxt};
1515
use rustc::mir::interpret::ConstValue;
1616
use rustc::util::nodemap::DefIdSet;
1717
use rustc_data_structures::sync::Lrc;
@@ -579,7 +579,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
579579
// parameter from the existential type
580580
return self.tcx()
581581
.global_tcx()
582-
.mk_const_param(param.index, param.name, ty);
582+
.mk_const_param(param.index, param.name, ct.ty);
583583
}
584584
}
585585
}

0 commit comments

Comments
 (0)