Module rustc_mir::build::matches::simplify [−][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?
Simplifying Candidates
Simplifying a match pair place @ pattern
means breaking it down
into bindings or other, simpler match pairs. For example:
place @ (P1, P2)
can be simplified to[place.0 @ P1, place.1 @ P2]
place @ x
can be simplified to[]
by bindingx
toplace
The simplify_candidate
routine just repeatedly applies these
sort of simplifications until there is nothing left to
simplify. Match pairs cannot be simplified if they require some
sort of test: for example, testing which variant an enum is, or
testing a value against a constant.
Re-exports
use build::BlockAnd; |
use build::BlockAndExtension; |
use build::Builder; |
use build::matches::Binding; |
use build::matches::MatchPair; |
use build::matches::Candidate; |
use hair::*; |
use rustc::mir::*; |
use std::mem; |