diff options
| author | bors <bors@rust-lang.org> | 2024-08-13 15:01:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-08-13 15:01:50 +0000 |
| commit | f96e296927cc0c6e9dd611edb943f6349001eca5 (patch) | |
| tree | 76c5e72c0570998ece04f11ac90e09b5d2613abc /compiler/rustc_mir_transform/src/coverage/graph.rs | |
| parent | 00423bb1d85f3513e534abdb26f54a6966e88d47 (diff) | |
| parent | 28af7e09581c3b39cdbf2850df2f157690ab7e56 (diff) | |
| download | rust-f96e296927cc0c6e9dd611edb943f6349001eca5.tar.gz rust-f96e296927cc0c6e9dd611edb943f6349001eca5.zip | |
Auto merge of #17880 - lnicola:sync-from-rust, r=lnicola
minor: sync from downstream
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/graph.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/graph.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/graph.rs b/compiler/rustc_mir_transform/src/coverage/graph.rs index 83fb9ff9743..31b20775194 100644 --- a/compiler/rustc_mir_transform/src/coverage/graph.rs +++ b/compiler/rustc_mir_transform/src/coverage/graph.rs @@ -1,3 +1,7 @@ +use std::cmp::Ordering; +use std::collections::VecDeque; +use std::ops::{Index, IndexMut}; + use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::graph::dominators::{self, Dominators}; @@ -7,10 +11,6 @@ use rustc_index::IndexVec; use rustc_middle::bug; use rustc_middle::mir::{self, BasicBlock, Terminator, TerminatorKind}; -use std::cmp::Ordering; -use std::collections::VecDeque; -use std::ops::{Index, IndexMut}; - /// A coverage-specific simplification of the MIR control flow graph (CFG). The `CoverageGraph`s /// nodes are `BasicCoverageBlock`s, which encompass one or more MIR `BasicBlock`s. #[derive(Debug)] @@ -350,8 +350,8 @@ fn bcb_filtered_successors<'a, 'tcx>(terminator: &'a Terminator<'tcx>) -> Covera // An inline asm terminator can normally be chained, except when it diverges or uses asm // goto. InlineAsm { ref targets, .. } => { - if targets.len() == 1 { - CoverageSuccessors::Chainable(targets[0]) + if let [target] = targets[..] { + CoverageSuccessors::Chainable(target) } else { CoverageSuccessors::NotChainable(targets) } |
