about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/const_goto.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-29 05:12:53 +0000
committerbors <bors@rust-lang.org>2022-08-29 05:12:53 +0000
commit94b2b15e63c5d2b2a6a0910e3dae554ce9415bf9 (patch)
tree52fe4cbdebc7c7b04dcd6a25793b8a8660969700 /compiler/rustc_mir_transform/src/const_goto.rs
parent7c142a61373eda083cec64de383cf79e9a173f16 (diff)
parentfa177a9db2d7c96ced985d018a0108de033f5ded (diff)
downloadrust-94b2b15e63c5d2b2a6a0910e3dae554ce9415bf9.tar.gz
rust-94b2b15e63c5d2b2a6a0910e3dae554ce9415bf9.zip
Auto merge of #101143 - matthiaskrgr:rollup-g8y5k0g, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #94890 (Support parsing IP addresses from a byte string)
 - #96334 (socket `set_mark` addition.)
 - #99027 (Replace `Body::basic_blocks()` with field access)
 - #100437 (Improve const mismatch `FulfillmentError`)
 - #100843 (Migrate part of rustc_infer to session diagnostic)
 - #100897 (extra sanity check against consts pointing to mutable memory)
 - #100959 (translations: rename warn_ to warning)
 - #101111 (Use the declaration's SourceInfo for FnEntry retags, not the outermost)
 - #101116 ([rustdoc] Remove Attrs type alias)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src/const_goto.rs')
-rw-r--r--compiler/rustc_mir_transform/src/const_goto.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/const_goto.rs b/compiler/rustc_mir_transform/src/const_goto.rs
index 5acf939f06b..0a305a40209 100644
--- a/compiler/rustc_mir_transform/src/const_goto.rs
+++ b/compiler/rustc_mir_transform/src/const_goto.rs
@@ -61,14 +61,14 @@ impl<'tcx> Visitor<'tcx> for ConstGotoOptimizationFinder<'_, 'tcx> {
         let _: Option<_> = try {
             let target = terminator.kind.as_goto()?;
             // We only apply this optimization if the last statement is a const assignment
-            let last_statement = self.body.basic_blocks()[location.block].statements.last()?;
+            let last_statement = self.body.basic_blocks[location.block].statements.last()?;
 
             if let (place, Rvalue::Use(Operand::Constant(_const))) =
                 last_statement.kind.as_assign()?
             {
                 // We found a constant being assigned to `place`.
                 // Now check that the target of this Goto switches on this place.
-                let target_bb = &self.body.basic_blocks()[target];
+                let target_bb = &self.body.basic_blocks[target];
 
                 // The `StorageDead(..)` statement does not affect the functionality of mir.
                 // We can move this part of the statement up to the predecessor.