1
Fork 0

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.
This commit is contained in:
Matthias Krüger 2022-08-29 06:34:43 +02:00 committed by GitHub
commit d182081de1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 131 additions and 140 deletions

View file

@ -272,7 +272,7 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
// by borrow checking.
debug_assert!(
!(body.local_decls.has_free_regions()
|| body.basic_blocks().has_free_regions()
|| body.basic_blocks.has_free_regions()
|| body.var_debug_info.has_free_regions()
|| body.yield_ty().has_free_regions()),
"Unexpected free regions in MIR: {:?}",