- if location.statement_index == block.statements.len() {
- // Add start location of the next blocks to pending locations.
- match block.terminator().kind {
- TerminatorKind::Goto { target } => {
- pending_locations.push(target.start_location());
- },
- TerminatorKind::SwitchInt { ref targets, .. } => {
- pending_locations.extend(
- targets.into_iter().map(|target| target.start_location()));
- },
- TerminatorKind::Drop { target, unwind, .. } |
- TerminatorKind::DropAndReplace { target, unwind, .. } |
- TerminatorKind::Assert { target, cleanup: unwind, .. } |
- TerminatorKind::Yield { resume: target, drop: unwind, .. } |
- TerminatorKind::FalseUnwind { real_target: target, unwind, .. } => {
- pending_locations.push(target.start_location());
- if let Some(unwind) = unwind {
- pending_locations.push(unwind.start_location());
- }
- },
- TerminatorKind::Call { ref destination, cleanup, .. } => {
- if let Some((_, destination)) = destination {
- pending_locations.push(destination.start_location());
- }
- if let Some(cleanup) = cleanup {
- pending_locations.push(cleanup.start_location());
- }
- },
- TerminatorKind::FalseEdges { real_target, ref imaginary_targets, .. } => {
- pending_locations.push(real_target.start_location());
- pending_locations.extend(
- imaginary_targets.into_iter().map(|target| target.start_location()));
- },
- _ => {},