fn bind_and_guard_matched_candidate(&mut self,
                                        mut block: BasicBlock,
                                        arm_blocks: &mut ArmBlocks,
                                        candidate: Candidate<'tcx>)
                                        -> Option<BasicBlock> {
        debug!("bind_and_guard_matched_candidate(block={:?}, candidate={:?})",
               block, candidate);

        debug_assert!(candidate.match_pairs.is_empty());

        self.bind_matched_candidate(block, candidate.bindings);

        let arm_block = arm_blocks.blocks[candidate.arm_index];

        if let Some(guard) = candidate.guard {
            // the block to branch to if the guard fails; if there is no
            // guard, this block is simply unreachable
            let cond = unpack!(block = self.as_operand(block, guard));
            let otherwise = self.cfg.start_new_block();
            self.cfg.terminate(block, Terminator::If { cond: cond,
                                                       targets: [arm_block, otherwise]});
            Some(otherwise)
        } else {
            self.cfg.terminate(block, Terminator::Goto { target: arm_block });
            None
        }
    }
/// Initializes each of the bindings from the candidate by
/// moving/copying/ref'ing the source as appropriate. Tests the
/// guard, if any, and then branches to the arm. Returns the block
/// for the case where the guard fails.
///
/// Note: we check earlier that if there is a guard, there cannot
/// be move bindings.  This isn't really important for the
/// self-consistency of this fn, but the reason for it should be
/// clear: after we've done the assignments, if there were move
/// bindings, further tests would be a use-after-move (which would
/// in turn be detected by the borrowck code that runs on the
/// MIR).
Initializes each of the bindings from the candidate by
moving/copying/ref'ing the source as appropriate. Tests the
guard, if any, and then branches to the arm. Returns the block
for the case where the guard fails.

we check earlier that if there is a guard, there cannot
be move bindings.  This isn't really important for the
self-consistency of this fn, but the reason for it should be
clear: after we've done the assignments, if there were move
bindings, further tests would be a use-after-move (which would
in turn be detected by the borrowck code that runs on the
MIR).
Initializes each of the bindings from the candidate by moving / copying / ref ' ing the source as appropriate . Tests the guard if any and then branches to the arm . Returns the block for the case where the guard fails . we check earlier that if there is a guard there cannot be move bindings . This isn ' t really important for the self - consistency of this fn but the reason for it should be clear : after we ' ve done the assignments if there were move bindings further tests would be a use - after - move ( which would in turn be detected by the borrowck code that runs on the MIR ) .
fn bind_and_guard_matched_candidate(&mut self,
                                        mut block: BasicBlock,
                                        arm_blocks: &mut ArmBlocks,
                                        candidate: Candidate<'tcx>)
                                        -> Option<BasicBlock> {
        debug!("bind_and_guard_matched_candidate(block={:?}, candidate={:?})",
               block, candidate);
        debug_assert!(candidate.match_pairs.is_empty());
        self.bind_matched_candidate(block, candidate.bindings);
        let arm_block = arm_blocks.blocks[candidate.arm_index];
        if let Some(guard) = candidate.guard {
            // the block to branch to if the guard fails; if there is no
            // guard, this block is simply unreachable
            let cond = unpack!(block = self.as_operand(block, guard));
            let otherwise = self.cfg.start_new_block();
            self.cfg.terminate(block, Terminator::If { cond: cond,
                                                       targets: [arm_block, otherwise]});
            Some(otherwise)
        } else {
            self.cfg.terminate(block, Terminator::Goto { target: arm_block });
            None
        }
    }
fn bind_and_guard_matched_candidate ( & mut self , mut block : BasicBlock , arm_blocks : & mut ArmBlocks , candidate : Candidate < ' tcx > ) -> Option < BasicBlock > { debug ! ( " " block candidate ) ; debug_assert ! ( candidate match_pairs is_empty ( ) ) ; self . bind_matched_candidate ( block , candidate . bindings ) ; let arm_block = arm_blocks . blocks [ candidate . arm_index ] ; if let Some ( guard ) = candidate . guard { // the block to branch to if the guard fails; if there is no // guard, this block is simply unreachable let cond = unpack ! ( block self as_operand ( block guard ) ) ; let otherwise = self . cfg . start_new_block ( ) ; self . cfg . terminate ( block , Terminator :: If { cond : cond , targets : [ arm_block , otherwise ] } ) ; Some ( otherwise ) } else { self . cfg . terminate ( block , Terminator :: Goto { target : arm_block } ) ; None } }
Initializes each of the bindings from the candidate by
moving/copying/ref'ing the source as appropriate.
Initializes each of the bindings from the candidate by moving / copying / ref ' ing the source as appropriate .
&mut self
block
BasicBlock
arm_blocks
&mut ArmBlocks
candidate
Candidate<'tcx>