Replace Body::basic_blocks() with field access
This commit is contained in:
@@ -89,7 +89,7 @@ fn local_eligible_for_nrvo(body: &mut mir::Body<'_>) -> Option<Local> {
|
||||
}
|
||||
|
||||
let mut copied_to_return_place = None;
|
||||
for block in body.basic_blocks().indices() {
|
||||
for block in body.basic_blocks.indices() {
|
||||
// Look for blocks with a `Return` terminator.
|
||||
if !matches!(body[block].terminator().kind, mir::TerminatorKind::Return) {
|
||||
continue;
|
||||
@@ -122,7 +122,7 @@ fn find_local_assigned_to_return_place(
|
||||
body: &mut mir::Body<'_>,
|
||||
) -> Option<Local> {
|
||||
let mut block = start;
|
||||
let mut seen = HybridBitSet::new_empty(body.basic_blocks().len());
|
||||
let mut seen = HybridBitSet::new_empty(body.basic_blocks.len());
|
||||
|
||||
// Iterate as long as `block` has exactly one predecessor that we have not yet visited.
|
||||
while seen.insert(block) {
|
||||
|
||||
Reference in New Issue
Block a user