Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
  • Loading branch information
jonas-schievink and bjorn3 committed Mar 8, 2020
1 parent 2cbccce commit cb58de8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/transform/generator.rs
Expand Up @@ -997,14 +997,14 @@ fn can_return<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>) -> bool {
return false;
}

// If there's no return terminator the function also won't return.
// If there's a return terminator the function may return.
for block in body.basic_blocks() {
if let TerminatorKind::Return = block.terminator().kind {
return true;
}
}

// Otherwise we assume that the function may return.
// Otherwise the function can't return.
false
}

Expand Down

0 comments on commit cb58de8

Please sign in to comment.