Skip to content

Commit d8712dc

Browse files
committed
Add fixme about a possible future relaxation
1 parent a6960c8 commit d8712dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_mir/src/transform/const_goto.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ impl<'a, 'tcx> Visitor<'tcx> for ConstGotoOptimizationFinder<'a, 'tcx> {
6565
// We found a constant being assigned to `place`.
6666
// Now check that the target of this Goto switches on this place.
6767
let target_bb = &self.body.basic_blocks()[target];
68+
// FIXME(simonvandel): We are conservative here when we don't allow
69+
// any statements in the target basic block.
70+
// This could probably be relaxed to allow `StorageDead`s which could be
71+
// copied to the predecessor of this block.
6872
if !target_bb.statements.is_empty() {
6973
None?
7074
}

0 commit comments

Comments
 (0)