diff options
| author | Martin Nordholts <enselic@gmail.com> | 2023-07-20 16:17:20 +0200 |
|---|---|---|
| committer | Martin Nordholts <enselic@gmail.com> | 2023-07-20 20:45:26 +0200 |
| commit | f92d6699b8600c037c15d2035065c3922e21099e (patch) | |
| tree | c09191ef57e3337e34dd5e2583f0ec2f0ee54653 | |
| parent | 092e4f46be168ab24d53e4141086b2cf04822b8e (diff) | |
| download | rust-f92d6699b8600c037c15d2035065c3922e21099e.tar.gz rust-f92d6699b8600c037c15d2035065c3922e21099e.zip | |
Avoid unneeded `terminator()` call in `fn ignore_edge()`
| -rw-r--r-- | compiler/rustc_mir_build/src/lints.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_build/src/lints.rs b/compiler/rustc_mir_build/src/lints.rs index 3f0cc69ec59..1dabc41a59f 100644 --- a/compiler/rustc_mir_build/src/lints.rs +++ b/compiler/rustc_mir_build/src/lints.rs @@ -155,9 +155,9 @@ impl<'mir, 'tcx> TriColorVisitor<BasicBlocks<'tcx>> for Search<'mir, 'tcx> { return true; } // Don't traverse successors of recursive calls or false CFG edges. - match self.body[bb].terminator().kind { - TerminatorKind::Call { ref func, ref args, .. } => self.is_recursive_call(func, args), - TerminatorKind::FalseEdge { imaginary_target, .. } => imaginary_target == target, + match &terminator.kind { + TerminatorKind::Call { func, args, .. } => self.is_recursive_call(func, args), + TerminatorKind::FalseEdge { imaginary_target, .. } => imaginary_target == &target, _ => false, } } |
