]> git.lizzy.rs Git - rust.git/commitdiff
impl mk_const_infer
authorGabriel Smith <ga29smith@gmail.com>
Fri, 1 Mar 2019 04:03:37 +0000 (23:03 -0500)
committervarkor <github@varkor.com>
Wed, 1 May 2019 22:10:57 +0000 (23:10 +0100)
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
src/librustc/ty/context.rs

index 150138ae0b9dc7db472feb3842f5dac37f72f554..ef94008811afd0a04ce28c455828122a4c638292 100644 (file)
@@ -2678,6 +2678,18 @@ pub fn mk_ty_infer(self, it: InferTy) -> Ty<'tcx> {
         self.mk_ty(Infer(it))
     }
 
+    #[inline]
+    pub fn mk_const_infer(
+        self,
+        ic: InferConst<'tcx>,
+        ty: Ty<'tcx>,
+    ) -> &'tcx LazyConst<'tcx> {
+        self.mk_lazy_const(LazyConst::Evaluated(ty::Const {
+            val: ConstValue::Infer(ic),
+            ty,
+        }))
+    }
+
     #[inline]
     pub fn mk_ty_param(self,
                        index: u32,