Skip to content

Commit 8cbbbaa

Browse files
varkoryodaldevoid
andcommitted
Add InferConst
Co-Authored-By: Gabriel Smith <[email protected]>
1 parent a36d386 commit 8cbbbaa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/librustc/ty/sty.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,3 +2228,14 @@ impl<'tcx> Const<'tcx> {
22282228
}
22292229

22302230
impl<'tcx> serialize::UseSpecializedDecodable for &'tcx LazyConst<'tcx> {}
2231+
2232+
/// An inference variable for a const, for use in const generics.
2233+
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
2234+
pub enum InferConst<'tcx> {
2235+
/// Infer the value of the const.
2236+
Var(ConstVid<'tcx>),
2237+
/// A fresh const variable. See `infer::freshen` for more details.
2238+
Fresh(u32),
2239+
/// Canonicalized const variable, used only when preparing a trait query.
2240+
Canonical(DebruijnIndex, BoundVar),
2241+
}

0 commit comments

Comments
 (0)