Enum cranelift_isle::trie_again::Constraint
source · pub enum Constraint {
Variant {
ty: TypeId,
variant: VariantId,
fields: TupleIndex,
},
ConstInt {
val: i128,
},
ConstPrim {
val: Sym,
},
Some,
}
Expand description
Pattern matches which can fail. Some binding sites are the result of successfully matching a constraint. A rule applies constraints to binding sites to determine whether the rule matches.
Variants§
Variant
Fields
§
ty: TypeId
Which enum type is being matched? This is implied by the binding where the constraint is applied, but recorded here for convenience.
§
fields: TupleIndex
Number of fields in this variant of this enum. This is recorded in the constraint for convenience, to avoid needing to look up the variant in a sema::TypeEnv.
The value must match this enum variant.
ConstInt
The value must equal this integer literal.
ConstPrim
The value must equal this Rust primitive value.
Some
The value must be an Option::Some
, from a fallible extractor.
Trait Implementations§
source§impl Clone for Constraint
impl Clone for Constraint
source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Constraint
impl Debug for Constraint
source§impl Hash for Constraint
impl Hash for Constraint
source§impl PartialEq<Constraint> for Constraint
impl PartialEq<Constraint> for Constraint
source§fn eq(&self, other: &Constraint) -> bool
fn eq(&self, other: &Constraint) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.