]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/mir/abstract_const.rs
initial working state
[rust.git] / compiler / rustc_middle / src / mir / abstract_const.rs
1 //! A subset of a mir body used for const evaluatability checking.
2 use crate::mir;
3 use crate::ty;
4
5 /// An index into an `AbstractConst`.
6 pub type NodeId = usize;
7
8 /// A node of an `AbstractConst`.
9 #[derive(Debug, Clone, Copy, PartialEq, Eq, HashStable)]
10 pub enum Node<'tcx> {
11     Leaf(&'tcx ty::Const<'tcx>),
12     Binop(mir::BinOp, NodeId, NodeId),
13     UnaryOp(mir::UnOp, NodeId),
14     FunctionCall(NodeId, &'tcx [NodeId]),
15 }