diff options
| author | bors <bors@rust-lang.org> | 2023-04-04 16:39:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-04 16:39:26 +0000 |
| commit | 540a50df0fb23127edf0b35b0e497748e24bba1a (patch) | |
| tree | 3c9c994e0515892b6f6e112fc251edbb9986466a /compiler/rustc_mir_transform/src/coverage/graph.rs | |
| parent | be8e5ba157a4ae494f9b4219b3b848e44ea5e8d3 (diff) | |
| parent | 678d7c505d26a0e969c6a49e18a642f7d7de9a98 (diff) | |
| download | rust-540a50df0fb23127edf0b35b0e497748e24bba1a.tar.gz rust-540a50df0fb23127edf0b35b0e497748e24bba1a.zip | |
Auto merge of #109941 - compiler-errors:rollup-5lsst2u, r=compiler-errors
Rollup of 9 pull requests Successful merges: - #109723 (Pull some tuple variant fields out into their own struct) - #109838 (Fix `non_exhaustive_omitted_patterns` lint span) - #109901 (Enforce VarDebugInfo::Place in MIR validation.) - #109913 (Doc-comment `IndexVec::from_elem` and use it in a few more places) - #109914 (Emit feature error for parenthesized generics in associated type bounds) - #109919 (rustdoc: escape GAT args in more cases) - #109937 (Don't collect return-position impl traits for documentation) - #109938 (Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible) - #109940 (Add regression test for #93911) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/graph.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/graph.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/graph.rs b/compiler/rustc_mir_transform/src/coverage/graph.rs index 689d6c71361..6a73f2a6578 100644 --- a/compiler/rustc_mir_transform/src/coverage/graph.rs +++ b/compiler/rustc_mir_transform/src/coverage/graph.rs @@ -37,8 +37,7 @@ impl CoverageGraph { // `SwitchInt` to have multiple targets to the same destination `BasicBlock`, so // de-duplication is required. This is done without reordering the successors. - let bcbs_len = bcbs.len(); - let mut seen = IndexVec::from_elem_n(false, bcbs_len); + let mut seen = IndexVec::from_elem(false, &bcbs); let successors = IndexVec::from_fn_n( |bcb| { for b in seen.iter_mut() { @@ -60,7 +59,7 @@ impl CoverageGraph { bcbs.len(), ); - let mut predecessors = IndexVec::from_elem_n(Vec::new(), bcbs.len()); + let mut predecessors = IndexVec::from_elem(Vec::new(), &bcbs); for (bcb, bcb_successors) in successors.iter_enumerated() { for &successor in bcb_successors { predecessors[successor].push(bcb); |
