]> git.lizzy.rs Git - rust.git/blob - src/test/ui/for-loop-while/liveness-assign-imm-local-after-loop.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / for-loop-while / liveness-assign-imm-local-after-loop.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(unused_assignments)]
4 // pretty-expanded FIXME #23616
5
6 #![allow(unreachable_code)]
7 #![allow(unused_variables)]
8
9 fn test(_cond: bool) {
10     let v: isize;
11     v = 1;
12     loop { } // loop never terminates, so no error is reported
13     v = 2;
14 }
15
16 pub fn main() {
17     // note: don't call test()... :)
18 }