Struct rustc_mir::hair::pattern::_match::Witness[][src]

pub struct Witness<'tcx>(Vec<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?

A stack of patterns in reverse order of construction

Methods

impl<'tcx> Witness<'tcx>
[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?

🔬 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?

🔬 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 }

Trait Implementations

impl<'tcx> Clone for Witness<'tcx>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'tcx> !Send for Witness<'tcx>

impl<'tcx> !Sync for Witness<'tcx>