Expand description
As explained in crate::usefulness, values and patterns are made from constructors applied to
fields. This file defines types that represent patterns in this way.
Re-exportsΒ§
use std::fmt;πuse smallvec::SmallVec;πuse smallvec::smallvec;πuse crate::constructor::Constructor;πuse crate::constructor::Slice;πuse crate::constructor::SliceKind;πuse crate::PatCx;πuse crate::PrivateUninhabitedField;πuse self::Constructor::*;π
StructsΒ§
- Deconstructed
Pat - Values and patterns can be represented as a constructor applied to some fields. This represents
a pattern in this form. A
DeconstructedPatwill almost always come from user input; the only exception are someWildcards introduced during pattern lowering. - Indexed
Pat - A pattern with an index denoting which field it corresponds to.
- PatId π
- A globally unique id to distinguish patterns.
- Witness
Pat - Same idea as
DeconstructedPat, except this is a fictitious pattern built up for diagnostics purposes. As such they donβt use interning and can be cloned.
EnumsΒ§
- PatOr
Wild π - Represents either a pattern obtained from user input or a wildcard constructed during the
algorithm. Do not use
Wildto represent a wildcard pattern comping from user input.