if let Some(all_facts) = self.all_facts {
if let Place::Local(temp) = place {
if let Some(borrow_indices) = self.borrow_set.local_map.get(temp) {
+ all_facts.killed.reserve(borrow_indices.len());
for &borrow_index in borrow_indices {
let location_index = self.location_table.mid_index(location);
all_facts.killed.push((borrow_index, location_index));
self.location_table.mid_index(location),
));
- for successor_block in terminator.successors() {
+ let successor_blocks = terminator.successors();
+ all_facts.cfg_edge.reserve(successor_blocks.size_hint().0);
+ for successor_block in successor_blocks {
all_facts.cfg_edge.push((
self.location_table.mid_index(location),
self.location_table
pending_locations.push(target.start_location());
},
TerminatorKind::SwitchInt { ref targets, .. } => {
- for target in targets {
- pending_locations.push(target.start_location());
- }
+ pending_locations.extend(
+ targets.into_iter().map(|target| target.start_location()));
},
TerminatorKind::Drop { target, unwind, .. } |
TerminatorKind::DropAndReplace { target, unwind, .. } |
},
TerminatorKind::FalseEdges { real_target, ref imaginary_targets, .. } => {
pending_locations.push(real_target.start_location());
- for target in imaginary_targets {
- pending_locations.push(target.start_location());
- }
+ pending_locations.extend(
+ imaginary_targets.into_iter().map(|target| target.start_location()));
},
_ => {},
}
argument_hir_ty: &hir::Ty,
counter: &mut usize,
) -> Option<RegionName> {
- let search_stack: &mut Vec<(Ty<'tcx>, &hir::Ty)> = &mut Vec::new();
-
- search_stack.push((argument_ty, argument_hir_ty));
+ let search_stack: &mut Vec<(Ty<'tcx>, &hir::Ty)> =
+ &mut vec![(argument_ty, argument_hir_ty)];
while let Some((ty, hir_ty)) = search_stack.pop() {
match (&ty.sty, &hir_ty.node) {