1
Fork 0

Apply suggestions from code review

Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
This commit is contained in:
Jonas Schievink 2020-03-08 13:51:26 +01:00 committed by GitHub
parent 2cbccced08
commit cb58de8165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}