]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/ty/consts/valtree.rs
Intern valtree field vector
[rust.git] / compiler / rustc_middle / src / ty / consts / valtree.rs
1 use super::ScalarInt;
2 use rustc_macros::HashStable;
3
4 #[derive(Copy, Clone, Debug, Hash, TyEncodable, TyDecodable, Eq, PartialEq, Ord, PartialOrd)]
5 #[derive(HashStable)]
6 pub enum ValTree<'tcx> {
7     Leaf(ScalarInt),
8     Branch(&'tcx [ValTree<'tcx>]),
9 }
10
11 impl ValTree<'tcx> {
12     pub fn zst() -> Self {
13         Self::Branch(&[])
14     }
15 }