]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/issue-100285.rs
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
[rust.git] / src / test / ui / typeck / issue-100285.rs
1 fn foo(n: i32) -> i32 {
2     for i in 0..0 {
3     //~^ ERROR: mismatched types [E0308]
4        if n < 0 {
5         return i;
6         } else if n < 10 {
7           return 1;
8         } else if n < 20 {
9           return 2;
10         } else if n < 30 {
11           return 3;
12         } else if n < 40 {
13           return 4;
14         } else {
15           return 5;
16         }
17
18     }
19     //~| 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
20 }
21
22 fn main() {}