Take ConstValue::Placeholder into account in new locations
This commit is contained in:
parent
fc16b0a147
commit
d8b9387ace
2 changed files with 5 additions and 3 deletions
|
@ -1355,6 +1355,7 @@ impl<'tcx> TypeFoldable<'tcx> for ConstValue<'tcx> {
|
|||
// FIXME(const_generics): implement TypeFoldable for InferConst
|
||||
ConstValue::Infer(ic) => ConstValue::Infer(ic),
|
||||
ConstValue::Param(p) => ConstValue::Param(p.fold_with(folder)),
|
||||
ConstValue::Placeholder(p) => ConstValue::Placeholder(p),
|
||||
ConstValue::Scalar(a) => ConstValue::Scalar(a),
|
||||
ConstValue::Slice(a, b) => ConstValue::Slice(a, b),
|
||||
ConstValue::Unevaluated(did, substs)
|
||||
|
@ -1366,8 +1367,9 @@ impl<'tcx> TypeFoldable<'tcx> for ConstValue<'tcx> {
|
|||
match *self {
|
||||
ConstValue::ByRef(..) => false,
|
||||
// FIXME(const_generics): implement TypeFoldable for InferConst
|
||||
ConstValue::Infer(_ic) => false,
|
||||
ConstValue::Infer(_) => false,
|
||||
ConstValue::Param(p) => p.visit_with(visitor),
|
||||
ConstValue::Placeholder(_) => false,
|
||||
ConstValue::Scalar(_) => false,
|
||||
ConstValue::Slice(..) => false,
|
||||
ConstValue::Unevaluated(_, substs) => substs.visit_with(visitor),
|
||||
|
|
|
@ -11,7 +11,7 @@ use rustc::infer::InferCtxt;
|
|||
use rustc::ty::adjustment::{Adjust, Adjustment, PointerCast};
|
||||
use rustc::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder};
|
||||
use rustc::ty::subst::UnpackedKind;
|
||||
use rustc::ty::{self, Ty, TyCtxt, Const};
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
use rustc::mir::interpret::ConstValue;
|
||||
use rustc::util::nodemap::DefIdSet;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
|
@ -579,7 +579,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
|
|||
// parameter from the existential type
|
||||
return self.tcx()
|
||||
.global_tcx()
|
||||
.mk_const_param(param.index, param.name, ty);
|
||||
.mk_const_param(param.index, param.name, ct.ty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue