about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-29 06:34:43 +0200
committerGitHub <noreply@github.com>2022-08-29 06:34:43 +0200
commitd182081de1ae2fe580c038abd526d85cedafa712 (patch)
tree0393e811cb218b1ee3d8a2a408a25d05d3ac29c9 /compiler/rustc_ty_utils
parenta96b44c9e2f952282cff1b833f39d10b8cda5f66 (diff)
parentb48870b451dd9d3f3f827aa54d9becdfdd811ba3 (diff)
downloadrust-d182081de1ae2fe580c038abd526d85cedafa712.tar.gz
rust-d182081de1ae2fe580c038abd526d85cedafa712.zip
Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk
Replace `Body::basic_blocks()` with field access

Since the refactoring in #98930, it is possible to borrow the basic blocks
independently from other parts of MIR by accessing the `basic_blocks` field
directly.

Replace unnecessary `Body::basic_blocks()` method with a direct field access,
which has an additional benefit of borrowing the basic blocks only.
Diffstat (limited to 'compiler/rustc_ty_utils')
-rw-r--r--compiler/rustc_ty_utils/src/ty.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs
index db0d45b86fc..acfeefb4d12 100644
--- a/compiler/rustc_ty_utils/src/ty.rs
+++ b/compiler/rustc_ty_utils/src/ty.rs
@@ -348,7 +348,7 @@ fn instance_def_size_estimate<'tcx>(
     match instance_def {
         InstanceDef::Item(..) | InstanceDef::DropGlue(..) => {
             let mir = tcx.instance_mir(instance_def);
-            mir.basic_blocks().iter().map(|bb| bb.statements.len() + 1).sum()
+            mir.basic_blocks.iter().map(|bb| bb.statements.len() + 1).sum()
         }
         // Estimate the size of other compiler-generated shims to be 1.
         _ => 1,