Struct rustc_mir::hair::pattern::_match::Witness [−][src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A stack of patterns in reverse order of construction
Methods
impl<'tcx> Witness<'tcx>
[src]
impl<'tcx> Witness<'tcx>
pub fn single_pattern(&self) -> &Pattern<'tcx>
[src]
pub fn single_pattern(&self) -> &Pattern<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn push_wild_constructor<'a>(
self,
cx: &MatchCheckCtxt<'a, 'tcx>,
ctor: &Constructor<'tcx>,
ty: Ty<'tcx>
) -> Self
[src]
fn push_wild_constructor<'a>(
self,
cx: &MatchCheckCtxt<'a, 'tcx>,
ctor: &Constructor<'tcx>,
ty: Ty<'tcx>
) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn apply_constructor<'a>(
self,
cx: &MatchCheckCtxt<'a, 'tcx>,
ctor: &Constructor<'tcx>,
ty: Ty<'tcx>
) -> Self
[src]
fn apply_constructor<'a>(
self,
cx: &MatchCheckCtxt<'a, 'tcx>,
ctor: &Constructor<'tcx>,
ty: Ty<'tcx>
) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Constructs a partial witness for a pattern given a list of patterns expanded by the specialization step.
When a pattern P is discovered to be useful, this function is used bottom-up to reconstruct a complete witness, e.g. a pattern P' that covers a subset of values, V, where each value in that set is not covered by any previously used patterns and is covered by the pattern P'. Examples:
left_ty: tuple of 3 elements pats: [10, 20, _] => (10, 20, _)
left_ty: struct X { a: (bool, &'static str), b: usize} pats: [(false, "foo"), 42] => X { a: (false, "foo"), b: 42 }