]> git.lizzy.rs Git - rust.git/commitdiff
Take ConstValue::Placeholder into account in new locations
authorvarkor <github@varkor.com>
Mon, 18 Mar 2019 21:00:52 +0000 (21:00 +0000)
committervarkor <github@varkor.com>
Wed, 1 May 2019 22:11:19 +0000 (23:11 +0100)
src/librustc/ty/structural_impls.rs
src/librustc_typeck/check/writeback.rs

index 3057c529ddfd47e63ce2fac812364f5124e919de..504b939c5f2d6bcf07d4827cb0b20db9e1595ee0 100644 (file)
@@ -1355,6 +1355,7 @@ fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F)
             // 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 @@ fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
         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),
index f56ef1a0d0c4e09da16848fddf0a0c963d99f653..5d98cb568bdaf74cfde2b76ea4bdf7dc71fc5eb3 100644 (file)
@@ -11,7 +11,7 @@
 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 @@ fn visit_opaque_types(&mut self, span: Span) {
                                         // 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);
                                     }
                                 }
                             }