]> git.lizzy.rs Git - rust.git/blob - tests/ui/infinite_loop.stderr
Merge pull request #2515 from kimsnj/infinite_loop
[rust.git] / tests / ui / infinite_loop.stderr
1 error: all variables in condition are immutable. This either leads to an infinite or to a never running loop.
2   --> $DIR/infinite_loop.rs:10:11
3    |
4 10 |     while y < 10 {
5    |           ^^^^^^
6    |
7    = note: `-D while-immutable-condition` implied by `-D warnings`
8
9 error: all variables in condition are immutable. This either leads to an infinite or to a never running loop.
10   --> $DIR/infinite_loop.rs:15:11
11    |
12 15 |     while y < 10 && x < 3 {
13    |           ^^^^^^^^^^^^^^^
14
15 error: all variables in condition are immutable. This either leads to an infinite or to a never running loop.
16   --> $DIR/infinite_loop.rs:22:11
17    |
18 22 |     while !cond {
19    |           ^^^^^
20
21 error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
22   --> $DIR/infinite_loop.rs:52:5
23    |
24 52 | /     while i < 3 {
25 53 | |         j = 3;
26 54 | |         println!("KO - i not mentionned");
27 55 | |     }
28    | |_____^
29
30 error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
31   --> $DIR/infinite_loop.rs:57:5
32    |
33 57 | /     while i < 3 && j > 0 {
34 58 | |         println!("KO - i and j not mentionned");
35 59 | |     }
36    | |_____^
37
38 error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
39   --> $DIR/infinite_loop.rs:61:5
40    |
41 61 | /     while i < 3 {
42 62 | |         let mut i = 5;
43 63 | |         fn_mutref(&mut i);
44 64 | |         println!("KO - shadowed");
45 65 | |     }
46    | |_____^
47
48 error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
49   --> $DIR/infinite_loop.rs:76:5
50    |
51 76 | /     while i < 3 {
52 77 | |         fn_constref(&i);
53 78 | |         println!("KO - const reference");
54 79 | |     }
55    | |_____^
56
57 error: Variable in the condition are not mutated in the loop body. This either leads to an infinite or to a never running loop.
58   --> $DIR/infinite_loop.rs:81:5
59    |
60 81 | /     while i < 3 {
61 82 | |         fn_val(i);
62 83 | |         println!("KO - passed by value");
63 84 | |     }
64    | |_____^
65
66 error: aborting due to 8 previous errors
67