fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB45 linesraw
1error[E0308]: mismatched types
2  --> $DIR/break-while-condition.rs:9:20
3   |
4LL |           let _: ! = {
5   |  ____________________^
6LL | |             'a: while break 'a {};
7LL | |         };
8   | |_________^ expected `!`, found `()`
9   |
10   = note:   expected type `!`
11           found unit type `()`
12
13error[E0308]: mismatched types
14  --> $DIR/break-while-condition.rs:16:13
15   |
16LL | /             while false {
17LL | |                 break
18LL | |             }
19   | |_____________^ expected `!`, found `()`
20   |
21   = note:   expected type `!`
22           found unit type `()`
23
24error[E0308]: mismatched types
25  --> $DIR/break-while-condition.rs:24:13
26   |
27LL | /             while false {
28LL | |                 return
29LL | |             }
30   | |_____________^ expected `!`, found `()`
31   |
32   = note:   expected type `!`
33           found unit type `()`
34note: the function expects a value to always be returned, but loops might run zero times
35  --> $DIR/break-while-condition.rs:24:13
36   |
37LL |             while false {
38   |             ^^^^^^^^^^^ this might have zero elements to iterate on
39LL |                 return
40   |                 ------ if the loop doesn't execute, this value would never get returned
41   = help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
42
43error: aborting due to 3 previous errors
44
45For more information about this error, try `rustc --explain E0308`.