diff options
| author | varkor <github@varkor.com> | 2019-02-20 01:10:11 +0000 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-03-05 22:07:37 +0000 |
| commit | 8cbbbaae6c1956d2c070e7f7447a9478adbf0dcd (patch) | |
| tree | 18414637407d505c08676d03e5600f0febdade50 /src | |
| parent | a36d386c6d08b6afbaf8316242218d9644b2ab82 (diff) | |
| download | rust-8cbbbaae6c1956d2c070e7f7447a9478adbf0dcd.tar.gz rust-8cbbbaae6c1956d2c070e7f7447a9478adbf0dcd.zip | |
Add InferConst
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/ty/sty.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index afe3dc2300a..3b58cca38dd 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -2228,3 +2228,14 @@ impl<'tcx> Const<'tcx> { } 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), +} |
