diff options
| author | bors <bors@rust-lang.org> | 2025-02-24 10:27:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-02-24 10:27:53 +0000 |
| commit | bb029a1d3f819471722f32dd9fcfa2c83d4f24f4 (patch) | |
| tree | fd4e4c3896ac33d634b549c77d2ad062cccea875 /compiler/rustc_mir_transform/src | |
| parent | f43e549b88698568581a9d329c7582e3708ac187 (diff) | |
| parent | 42014b44b3d91e6567bb666f02c37ba537af00d0 (diff) | |
| download | rust-bb029a1d3f819471722f32dd9fcfa2c83d4f24f4.tar.gz rust-bb029a1d3f819471722f32dd9fcfa2c83d4f24f4.zip | |
Auto merge of #137511 - jhpratt:rollup-07whsax, r=jhpratt
Rollup of 10 pull requests
Successful merges:
- #136610 (Allow `IndexSlice` to be indexed by ranges.)
- #136991 ([rustdoc] Add new setting to wrap source code lines when too long)
- #137061 (Unstable `gen_future` Feature Tracking )
- #137393 (Stabilize `unbounded_shifts`)
- #137482 (Windows: use existing wrappers in `File::open_native`)
- #137484 (Fix documentation for unstable sort on slice)
- #137491 (Tighten `str-to-string-128690.rs``CHECK{,-NOT}`s to make it less likely to incorrectly fail with symbol name mangling)
- #137495 (Added into_value function to ControlFlow<T, T>)
- #137501 (Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`)
- #137505 (Add a span to `CompilerBuiltinsCannotCall`)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src')
4 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/check_pointers.rs b/compiler/rustc_mir_transform/src/check_pointers.rs index d693f739180..2d04b621935 100644 --- a/compiler/rustc_mir_transform/src/check_pointers.rs +++ b/compiler/rustc_mir_transform/src/check_pointers.rs @@ -71,8 +71,7 @@ pub(crate) fn check_pointers<'tcx, F>( // statements/blocks after. Iterating or visiting the MIR in order would require updating // our current location after every insertion. By iterating backwards, we dodge this issue: // The only Locations that an insertion changes have already been handled. - for block in (0..basic_blocks.len()).rev() { - let block = block.into(); + for block in basic_blocks.indices().rev() { for statement_index in (0..basic_blocks[block].statements.len()).rev() { let location = Location { block, statement_index }; let statement = &basic_blocks[block].statements[statement_index]; diff --git a/compiler/rustc_mir_transform/src/coverage/counters.rs b/compiler/rustc_mir_transform/src/coverage/counters.rs index 039f346495b..5568d42ab8f 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters.rs @@ -50,7 +50,7 @@ fn make_node_flow_priority_list( // A "reloop" node has exactly one out-edge, which jumps back to the top // of an enclosing loop. Reloop nodes are typically visited more times // than loop-exit nodes, so try to avoid giving them physical counters. - let is_reloop_node = IndexVec::from_fn_n( + let is_reloop_node = IndexVec::<BasicCoverageBlock, _>::from_fn_n( |node| match graph.successors[node].as_slice() { &[succ] => graph.dominates(succ, node), _ => false, diff --git a/compiler/rustc_mir_transform/src/coverage/graph.rs b/compiler/rustc_mir_transform/src/coverage/graph.rs index 09384defea8..dcc7c5b91d7 100644 --- a/compiler/rustc_mir_transform/src/coverage/graph.rs +++ b/compiler/rustc_mir_transform/src/coverage/graph.rs @@ -42,7 +42,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 successors = IndexVec::from_fn_n( + let successors = IndexVec::<BasicCoverageBlock, _>::from_fn_n( |bcb| { let mut seen_bcbs = FxHashSet::default(); let terminator = mir_body[bcbs[bcb].last_bb()].terminator(); diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index 2f8a3050199..29521d42720 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -1259,7 +1259,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> { let layout = self.ecx.layout_of(lhs_ty).ok()?; - let as_bits = |value| { + let as_bits = |value: VnIndex| { let constant = self.evaluated[value].as_ref()?; if layout.backend_repr.is_scalar() { let scalar = self.ecx.read_scalar(constant).discard_err()?; |
