Skip to content

Commit f92d669

Browse files
committed
Avoid unneeded terminator() call in fn ignore_edge()
1 parent 092e4f4 commit f92d669

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: compiler/rustc_mir_build/src/lints.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ impl<'mir, 'tcx> TriColorVisitor<BasicBlocks<'tcx>> for Search<'mir, 'tcx> {
155155
return true;
156156
}
157157
// Don't traverse successors of recursive calls or false CFG edges.
158-
match self.body[bb].terminator().kind {
159-
TerminatorKind::Call { ref func, ref args, .. } => self.is_recursive_call(func, args),
160-
TerminatorKind::FalseEdge { imaginary_target, .. } => imaginary_target == target,
158+
match &terminator.kind {
159+
TerminatorKind::Call { func, args, .. } => self.is_recursive_call(func, args),
160+
TerminatorKind::FalseEdge { imaginary_target, .. } => imaginary_target == &target,
161161
_ => false,
162162
}
163163
}

0 commit comments

Comments
 (0)