pub type WitnessPat<'p, 'tcx> = WitnessPat<RustcPatCtxt<'p, 'tcx>>;
Aliased Type§
struct WitnessPat<'p, 'tcx> {
ctor: Constructor<RustcPatCtxt<'p, 'tcx>>,
pub(crate) fields: Vec<WitnessPat<RustcPatCtxt<'p, 'tcx>>>,
ty: RevealedTy<'tcx>,
}
Fields§
§ctor: Constructor<RustcPatCtxt<'p, 'tcx>>
§fields: Vec<WitnessPat<RustcPatCtxt<'p, 'tcx>>>
§ty: RevealedTy<'tcx>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 112 bytes
Implementations
Source§impl<Cx: PatCx> WitnessPat<Cx>
impl<Cx: PatCx> WitnessPat<Cx>
pub(crate) fn new(ctor: Constructor<Cx>, fields: Vec<Self>, ty: Cx::Ty) -> Self
Sourcepub(crate) fn wildcard(cx: &Cx, ty: Cx::Ty) -> Self
pub(crate) fn wildcard(cx: &Cx, ty: Cx::Ty) -> Self
Create a wildcard pattern for this type. If the type is empty, we create a !
pattern.
Sourcepub(crate) fn wild_from_ctor(cx: &Cx, ctor: Constructor<Cx>, ty: Cx::Ty) -> Self
pub(crate) fn wild_from_ctor(cx: &Cx, ctor: Constructor<Cx>, ty: Cx::Ty) -> Self
Construct a pattern that matches everything that starts with this constructor.
For example, if ctor
is a Constructor::Variant
for Option::Some
, we get the pattern
Some(_)
.