about summary refs log tree commit diff
path: root/tests/ui/mir/unreachable-loop-jump-threading.rs
blob: 8403906bb5c0ce7667c9b8cf98121ca15ac8dfb3 (plain)
1
2
3
4
5
6
7
8
9
10
//@ build-pass
//@ needs-rustc-debug-assertions
//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+JumpThreading --crate-type=lib

pub fn fun(terminate: bool) {
    while true {}
    //~^ WARN denote infinite loops with `loop { ... }`

    while !terminate {}
}