]> git.lizzy.rs Git - rust.git/commitdiff
Add InferConst
authorvarkor <github@varkor.com>
Wed, 20 Feb 2019 01:10:11 +0000 (01:10 +0000)
committervarkor <github@varkor.com>
Tue, 5 Mar 2019 22:07:37 +0000 (22:07 +0000)
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
src/librustc/ty/sty.rs

index afe3dc2300a8bc1d2f63c26a997b17ca9d405fce..3b58cca38dd1178bab4df2b0cf5468e49c2b994e 100644 (file)
@@ -2228,3 +2228,14 @@ pub fn unwrap_usize(&self, tcx: TyCtxt<'_, '_, '_>) -> u64 {
 }
 
 impl<'tcx> serialize::UseSpecializedDecodable for &'tcx LazyConst<'tcx> {}
+
+/// An inference variable for a const, for use in const generics.
+#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
+pub enum InferConst<'tcx> {
+    /// Infer the value of the const.
+    Var(ConstVid<'tcx>),
+    /// A fresh const variable. See `infer::freshen` for more details.
+    Fresh(u32),
+    /// Canonicalized const variable, used only when preparing a trait query.
+    Canonical(DebruijnIndex, BoundVar),
+}