Closed
Description
cc @rust-lang/wg-mir-opt
if we have a basic block with no statements and just a return terminator, any other basic block that just goto
s into that block could just as well call return
itself. Or do we have some rule that we can only have a single return terminator per mir::Body
?
Maybe we can generalize this and bubble any terminator of a statement-less block into its predecessor terminators iff that predecessor terminator is a goto
.
As an example take
which is a basic block with no statements and just areturn
terminator, and both predecessor blocks have a goto
to this block.