From 4ce2123ecc2b23b270cf869dff2dacb4f72cf745 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 4 May 2023 21:10:12 +0000 Subject: yeet ConstInferUnifier --- compiler/rustc_middle/src/ty/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index b414e1200cd..2fe0b2938ef 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1070,6 +1070,24 @@ impl ParamTerm { } } +#[derive(Copy, Clone, Eq, PartialEq, Debug)] +pub enum TermVid<'tcx> { + Ty(ty::TyVid), + Const(ty::ConstVid<'tcx>), +} + +impl From for TermVid<'_> { + fn from(value: ty::TyVid) -> Self { + TermVid::Ty(value) + } +} + +impl<'tcx> From> for TermVid<'tcx> { + fn from(value: ty::ConstVid<'tcx>) -> Self { + TermVid::Const(value) + } +} + /// This kind of predicate has no *direct* correspondent in the /// syntax, but it roughly corresponds to the syntactic forms: /// -- cgit 1.4.1-3-g733a5