]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-27042.stderr
4244f36e481802b92208ae1bcee9375fc2802341
[rust.git] / src / test / ui / issues / issue-27042.stderr
1 warning: denote infinite loops with `loop { ... }`
2   --> $DIR/issue-27042.rs:8:9
3    |
4 LL | /         'b:
5 LL | |
6 LL | |         while true { break }; // but here we cite the whole loop
7    | |____________________________^ help: use `loop`
8    |
9    = note: `#[warn(while_true)]` on by default
10
11 error[E0308]: mismatched types
12   --> $DIR/issue-27042.rs:6:16
13    |
14 LL |         loop { break };
15    |                ^^^^^
16    |                |
17    |                expected i32, found ()
18    |                help: give it a value of the expected type: `break 42`
19    |
20    = note:   expected type `i32`
21            found unit type `()`
22
23 error[E0308]: mismatched types
24   --> $DIR/issue-27042.rs:8:9
25    |
26 LL | /         'b:
27 LL | |
28 LL | |         while true { break }; // but here we cite the whole loop
29    | |____________________________^ expected i32, found ()
30    |
31    = note:   expected type `i32`
32            found unit type `()`
33
34 error[E0308]: mismatched types
35   --> $DIR/issue-27042.rs:12:9
36    |
37 LL | /         'c:
38 LL | |         for _ in None { break }; // but here we cite the whole loop
39    | |_______________________________^ expected i32, found ()
40    |
41    = note:   expected type `i32`
42            found unit type `()`
43
44 error[E0308]: mismatched types
45   --> $DIR/issue-27042.rs:15:9
46    |
47 LL | /         'd:
48 LL | |         while let Some(_) = None { break };
49    | |__________________________________________^ expected i32, found ()
50    |
51    = note:   expected type `i32`
52            found unit type `()`
53
54 error: aborting due to 4 previous errors
55
56 For more information about this error, try `rustc --explain E0308`.