diff options
| author | Gabriel Smith <ga29smith@gmail.com> | 2019-02-28 23:03:37 -0500 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-05-01 23:10:57 +0100 |
| commit | e965b756035f5c746f79d04369e0b33ffa71e10e (patch) | |
| tree | af2a6ec5c0bed7f4d7e19558601eb50aee84f955 | |
| parent | bd2fa222c0d1b768f2c4d3eb17828184b4a26d1c (diff) | |
| download | rust-e965b756035f5c746f79d04369e0b33ffa71e10e.tar.gz rust-e965b756035f5c746f79d04369e0b33ffa71e10e.zip | |
impl mk_const_infer
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
| -rw-r--r-- | src/librustc/ty/context.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 150138ae0b9..ef94008811a 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -2679,6 +2679,18 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } #[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, name: InternedString) -> Ty<'tcx> { |
