We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75e7cf5 commit 4ff39bcCopy full SHA for 4ff39bc
compiler/rustc_mir_transform/src/jump_threading.rs
@@ -89,7 +89,7 @@ impl<'tcx> crate::MirPass<'tcx> for JumpThreading {
89
opportunities: Vec::new(),
90
};
91
92
- for bb in body.basic_blocks.indices() {
+ for (bb, _) in traversal::preorder(body) {
93
finder.start_from_switch(bb);
94
}
95
tests/crashes/131451.rs renamed to tests/ui/mir/unreachable-loop-jump-threading.rs
@@ -1,9 +1,10 @@
1
-//@ known-bug: #131451
+//@ build-pass
2
//@ needs-rustc-debug-assertions
3
//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+JumpThreading --crate-type=lib
4
5
pub fn fun(terminate: bool) {
6
while true {}
7
+ //~^ WARN denote infinite loops with `loop { ... }`
8
9
while !terminate {}
10
0 commit comments