1 //! A subset of a mir body used for const evaluatability checking.
5 rustc_index::newtype_index! {
6 /// An index into an `AbstractConst`.
13 /// A node of an `AbstractConst`.
14 #[derive(Debug, Clone, Copy, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)]
16 Leaf(&'tcx ty::Const<'tcx>),
17 Binop(mir::BinOp, NodeId, NodeId),
18 UnaryOp(mir::UnOp, NodeId),
19 FunctionCall(NodeId, &'tcx [NodeId]),
22 #[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)]
23 pub enum NotConstEvaluatable {
24 Error(rustc_errors::ErrorReported),
29 impl From<rustc_errors::ErrorReported> for NotConstEvaluatable {
30 fn from(e: rustc_errors::ErrorReported) -> NotConstEvaluatable {
31 NotConstEvaluatable::Error(e)
35 TrivialTypeFoldableAndLiftImpls! {